71 iVector(aOther.iVector) {}
73 iVector(
std::move(aOther.iVector)) {}
79 iVector(aOtherContainer) {}
80 vector(std::initializer_list<value_type> aValues) :
82 template <
typename InputIter>
83 vector(InputIter aFirst, InputIter aLast) :
84 iVector(aFirst, aLast) {}
92 iVector = std::move(aOther.iVector);
114 template <
typename... Args>
117 auto newPos = iVector.emplace(iVector.begin() + (aPos -
abstract_type::cbegin()), std::forward<Args>(aArgs)...);
122 constexpr bool operator==(
const self_type& that)
const noexcept
126 constexpr std::partial_ordering
operator<=>(
const self_type& that)
const noexcept
135 return iVector.size();
139 return iVector.max_size();
150 std::copy(aOther.begin(), aOther.end(), std::back_insert_iterator{ iVector });
182 return iVector.capacity();
186 iVector.reserve(aCapacity);
190 if constexpr (std::is_default_constructible_v<value_type>)
191 iVector.resize(aSize);
192 else if (aSize <=
size())
193 iVector.erase(
std::next(iVector.begin(), aSize), iVector.end());
195 throw std::logic_error{
"neolib::vector::value_type not default constructible" };
199 iVector.resize(aSize, aValue);
203 iVector.push_back(aValue);
205 template <
typename... Args>
208 iVector.emplace_back(std::forward<Args>(aArgs)...);
216 return iVector.front();
220 return iVector.front();
224 return iVector.back();
228 return iVector.back();
234 return iVector.data();
238 return iVector.data();
242 return iVector.data();
247 return iVector.at(aIndex);
251 return iVector.at(aIndex);
255 return iVector[aIndex];
259 return iVector[aIndex];
262 std::ptrdiff_t iterator_offset() const final
274 std::vector<value_type> iVector;
IteratorType abstract_iterator
const_iterator begin() const
const_iterator cbegin() const
ConstIteratorType abstract_const_iterator
i_container< T, ConstIteratorType, IteratorType > generic_container_type
i_random_access_iterator< T > abstract_iterator
i_random_access_const_iterator< T > abstract_const_iterator
offset_iterator< value_type > iterator
offset_iterator< const value_type > const_iterator
const value_type & at(size_type aIndex) const final
const value_type * data() const noexcept final
vector(std_type const &aOtherContainer)
std_type & as_std_vector()
vector(std::initializer_list< value_type > aValues)
const std_type & as_std_vector() const
constexpr bool operator==(const self_type &that) const noexcept
vector & operator=(i_vector< abstract_value_type > const &aOther)
constexpr std::partial_ordering operator<=>(const self_type &that) const noexcept
void resize(size_type aSize) final
value_type & at(size_type aIndex) final
const value_type * cdata() const noexcept final
value_type & front() final
const value_type & operator[](size_type aIndex) const final
vector(i_vector< abstract_value_type > const &aOther)
container::random_access_iterator< T, typename std_type::iterator, typename std_type::const_iterator > container_iterator
void emplace_back(Args &&... aArgs)
size_type capacity() const final
value_type * data() noexcept final
value_type & operator[](size_type aIndex) final
void resize(size_type aSize, abstract_value_type const &aValue) final
container::random_access_const_iterator< T, typename std_type::const_iterator > container_const_iterator
abstract_t< T > abstract_value_type
std::vector< value_type > std_type
vector(vector const &aOther)
const value_type & back() const final
void reserve(size_type aCapacity) final
void push_back(abstract_value_type const &aValue) final
size_type max_size() const noexcept final
vector & operator=(vector &&aOther)
vector & operator=(vector const &aOther)
iterator emplace(const_iterator aPos, Args &&... aArgs)
vector(InputIter aFirst, InputIter aLast)
i_vector< abstract_t< T > > abstract_type
const value_type & front() const final
std_type to_std_vector() const
value_type & back() final
size_type size() const noexcept final
void assign(generic_container_type const &aOther) final
typename detail::abstract_type< T >::type abstract_t
it_type next(it_type it, const typename iterator_traits< it_type >::difference_type distance=1)