Changeset - r23537:f6a6d4ce4bd5
[Not reviewed]
master
0 1 0
Henry Wilson - 6 years ago 2019-03-03 15:20:29
m3henry@googlemail.com
Codechange: Declare SmallVector as an alias for std::vector
1 file changed with 2 insertions and 37 deletions:
0 comments (0 inline, 0 general)
src/core/smallvec_type.hpp
Show inline comments
 
@@ -42,51 +42,16 @@ inline bool include(std::vector<T>& vec,
 
 *       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 <typename T, uint S>
 
class SmallVector : public std::vector<T> {
 
public:
 
	SmallVector() = default;
 

	
 
	/**
 
	 * Copy constructor.
 
	 * @param other The other vector to copy.
 
	 */
 
	SmallVector(const SmallVector &other) = default;
 

	
 
	/**
 
	 * Generic copy constructor.
 
	 * @param other The other vector to copy.
 
	 */
 
	template <uint X>
 
	SmallVector(const SmallVector<T, X> &other) : std::vector<T>(other)
 
	{
 
	}
 

	
 
	/**
 
	 * Assignment.
 
	 * @param other The other vector to assign.
 
	 */
 
	SmallVector &operator=(const SmallVector &other) = default;
 

	
 
	/**
 
	 * Generic assignment.
 
	 * @param other The other vector to assign.
 
	 */
 
	template <uint X>
 
	SmallVector &operator=(const SmallVector<T, X> &other)
 
	{
 
		std::vector<T>::operator=(other);
 
		return *this;
 
	}
 

	
 
	~SmallVector() = default;
 
};
 
template <typename T, uint S>
 
using SmallVector = std::vector<T>;
 

	
 
/**
 
 * Helper function to get the index of an item
 
 * Consider using std::set, std::unordered_set or std::flat_set in new code
 
 *
 
 * @param vec A reference to the vector to be extended
0 comments (0 inline, 0 general)