10 #ifndef SMALLVEC_TYPE_HPP 11 #define SMALLVEC_TYPE_HPP 28 inline bool include(std::vector<T>& vec,
const T &item)
30 const bool is_member = std::find(vec.begin(), vec.end(), item) != vec.end();
31 if (!is_member) vec.emplace_back(item);
47 auto const it = std::find(vec.begin(), vec.end(), item);
48 if (it != vec.end())
return it - vec.begin();
Functions related to the allocation of memory.
bool include(std::vector< T > &vec, const T &item)
Helper function to append an item to a vector if it is not already contained Consider using std::set...
Functions related to memory operations.
int find_index(std::vector< T > const &vec, T const &item)
Helper function to get the index of an item Consider using std::set, std::unordered_set or std::flat_...