10 explicit NamedIndex(
size_t value) : value_(value)
18 bool has_value()
const
20 return value_ != SIZE_MAX;
28 size_t operator++(
int)
33 auto operator+(
size_t other)
const
40 return get() < other.get();
45 return get() == other.get();
56 using vector_type = std::vector<T>;
59 static index_type make_index(
typename vector_type::size_type i)
64 typename vector_type::reference at(
index_type i)
66 return vec.at(i.get());
69 typename vector_type::const_reference at(
index_type i)
const
71 return vec.at(i.get());
74 void push_back(
const T &value)
79 template <
class... Args>
void emplace_back(Args &&...args)
81 vec.emplace_back(std::forward<Args>(args)...);
86 return make_index(vec.size());
89 void reserve(
size_t s)
Definition: named_vector.hpp:53
Definition: named_vector.hpp:8