From c01a2e2a81d8e7bcd47d46292ed0b7d452081c31 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 3 Mar 2019 17:30:09 +0000 Subject: Codechange: Removed SmallVector completely --- src/core/pool_type.hpp | 2 +- src/core/smallmap_type.hpp | 2 +- src/core/smallstack_type.hpp | 2 +- src/core/smallvec_type.hpp | 27 +++++---------------------- 4 files changed, 8 insertions(+), 25 deletions(-) (limited to 'src/core') diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index a6f7e4fe8..38f314ebb 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -26,7 +26,7 @@ enum PoolType { }; DECLARE_ENUM_AS_BIT_SET(PoolType) -typedef SmallVector PoolVector; ///< Vector of pointers to PoolBase +typedef std::vector PoolVector; ///< Vector of pointers to PoolBase /** Base class for base of all pools. */ struct PoolBase { diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index 8cc96302f..debd4165e 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -40,7 +40,7 @@ struct SmallPair { * @see SmallVector */ template -struct SmallMap : SmallVector, S> { +struct SmallMap : std::vector > { typedef ::SmallPair Pair; typedef Pair *iterator; typedef const Pair *const_iterator; diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index 5a9d329a9..c273fdec4 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -87,7 +87,7 @@ private: Tindex first_free; ThreadMutex *mutex; - SmallVector data; + std::vector data; }; /** diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 6f86e11cc..19dab2228 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -34,22 +34,6 @@ inline bool include(std::vector& vec, const T &item) return is_member; } - -/** - * Simple vector template class. - * - * @note There are no asserts in the class so you have - * to care about that you grab an item which is - * inside the list. - * - * @tparam T The type of the items stored - * @tparam S The steps of allocation - */ - - -template -using SmallVector = std::vector; - /** * Helper function to get the index of an item * Consider using std::set, std::unordered_set or std::flat_set in new code @@ -73,19 +57,18 @@ int find_index(std::vector const& vec, T const& item) * Consider using std::back_inserter in new code * * @param vec A reference to the vector to be extended - * @param num The number of elements to default-construct + * @param num Number of elements to be default-constructed * * @return Pointer to the first new element */ template -inline T* grow(std::vector& vec, std::size_t num) +T* grow(std::vector& vec, std::size_t num) { - const std::size_t pos = vec.size(); + std::size_t const pos = vec.size(); vec.resize(pos + num); return vec.data() + pos; } - /** * Simple vector template class, with automatic free. * @@ -97,7 +80,7 @@ inline T* grow(std::vector& vec, std::size_t num) * @param S The steps of allocation */ template -class AutoFreeSmallVector : public SmallVector { +class AutoFreeSmallVector : public std::vector { public: ~AutoFreeSmallVector() { @@ -128,7 +111,7 @@ public: * @param S The steps of allocation */ template -class AutoDeleteSmallVector : public SmallVector { +class AutoDeleteSmallVector : public std::vector { public: ~AutoDeleteSmallVector() { -- cgit v1.2.3-54-g00ecf