cpp-common: rename `bt2_common` namespace -> `bt2c`
[babeltrace.git] / src / cpp-common / vector.hpp
diff --git a/src/cpp-common/vector.hpp b/src/cpp-common/vector.hpp
deleted file mode 100644 (file)
index 2d6b6cb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2022 Simon Marchi <simon.marchi@efficios.com>
- *
- * SPDX-License-Identifier: MIT
- */
-
-#ifndef SRC_CPP_COMMON_VECTOR_HPP
-#define SRC_CPP_COMMON_VECTOR_HPP
-
-#include <vector>
-
-#include "common/assert.h"
-
-namespace bt2_common {
-
-/*
- * Moves the last entry of `vec` to the index `idx`, then removes the last entry.
- *
- * Meant to be a direct replacement for g_ptr_array_remove_index_fast(), but for
- * `std::vector`.
- */
-template <typename T, typename AllocatorT>
-void vectorFastRemove(std::vector<T, AllocatorT>& vec,
-                      const typename std::vector<T, AllocatorT>::size_type idx)
-{
-    BT_ASSERT_DBG(idx < vec.size());
-
-    if (idx < vec.size() - 1) {
-        vec[idx] = std::move(vec.back());
-    }
-
-    vec.pop_back();
-}
-
-} /* namespace bt2_common */
-
-#endif /* SRC_CPP_COMMON_VECTOR_HPP */
This page took 0.024979 seconds and 4 git commands to generate.