71 iDeque(aOther.iDeque) {}
73 iDeque(
std::move(aOther.iDeque)) {}
79 iDeque(aOtherContainer) {}
80 deque(std::initializer_list<value_type> aValues) :
82 template <
typename InputIter>
83 deque(InputIter aFirst, InputIter aLast) :
84 iDeque(aFirst, aLast) {}
92 iDeque = std::move(aOther.iDeque);
114 template <
typename... Args>
117 auto newPos = iDeque.emplace(iDeque.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 iDeque.size();
139 return iDeque.max_size();
150 std::copy(aOther.begin(), aOther.end(), std::back_insert_iterator{ iDeque });
182 return iDeque.max_size();
190 if constexpr (std::is_default_constructible_v<value_type>)
191 iDeque.resize(aSize);
192 else if (aSize <=
size())
193 iDeque.erase(
std::next(iDeque.begin(), aSize), iDeque.end());
195 throw std::logic_error{
"neolib::deque::value_type not default constructible" };
199 iDeque.resize(aSize, aValue);
203 iDeque.push_front(aValue);
205 template <
typename... Args>
208 iDeque.emplace_front(std::forward<Args>(aArgs)...);
216 iDeque.push_back(aValue);
218 template <
typename... Args>
221 iDeque.emplace_back(std::forward<Args>(aArgs)...);
229 return iDeque.front();
233 return iDeque.front();
237 return iDeque.back();
241 return iDeque.back();
247 return iDeque.at(aIndex);
251 return iDeque.at(aIndex);
255 return iDeque[aIndex];
259 return iDeque[aIndex];
269 std::deque<value_type> iDeque;
const value_type & at(size_type aIndex) const final
const std_type & as_std_deque() const
value_type & at(size_type aIndex) final
std::deque< value_type > std_type
void emplace_front(Args &&... aArgs)
size_type capacity() const final
void push_front(const abstract_value_type &aValue) final
deque(InputIter aFirst, InputIter aLast)
const value_type & back() const final
deque(const std_type &aOtherContainer)
deque(std::initializer_list< value_type > aValues)
iterator emplace(const_iterator aPos, Args &&... aArgs)
abstract_t< T > abstract_value_type
std_type & as_std_deque()
i_deque< abstract_t< T > > abstract_type
std_type to_std_deque() const
size_type max_size() const noexcept final
constexpr std::partial_ordering operator<=>(const self_type &that) const noexcept
void resize(size_type aSize, const abstract_value_type &aValue) final
deque & operator=(deque &&aOther)
void reserve(size_type aCapacity) final
void push_back(const abstract_value_type &aValue) final
const value_type & operator[](size_type aIndex) const final
container::random_access_iterator< T, typename std_type::iterator, typename std_type::const_iterator > container_iterator
deque(const deque &aOther)
deque & operator=(const i_deque< abstract_value_type > &aOther)
size_type size() const noexcept final
deque & operator=(const deque &aOther)
deque(const i_deque< abstract_value_type > &aOther)
container::random_access_const_iterator< T, typename std_type::const_iterator > container_const_iterator
value_type & front() final
constexpr bool operator==(const self_type &that) const noexcept
value_type & operator[](size_type aIndex) final
void assign(const generic_container_type &aOther) final
const value_type & front() const final
void emplace_back(Args &&... aArgs)
value_type & back() final
void resize(size_type aSize) final
IteratorType abstract_iterator
const_iterator begin() const
abstract_const_iterator::iterator_wrapper const_iterator
const_iterator cbegin() const
abstract_iterator::iterator_wrapper iterator
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
typename detail::abstract_type< T >::type abstract_t
it_type next(it_type it, const typename iterator_traits< it_type >::difference_type distance=1)