13 template <
class... Args>
15 item(
std::forward<Args>(a_args)...)
30 return malloc<BSTListNode<T>>();
39 template <
class T,
class Allocator = BSTListHeapAllocator<T>>
73 if (
this != std::addressof(a_rhs)) {
81 if (
this != std::addressof(a_rhs)) {
82 _cur = std::move(a_rhs._cur);
191 return _sentinel->next->item;
196 return _sentinel->next->item;
201 return _sentinel->prev->item;
206 return _sentinel->prev->item;
211 return iterator(_sentinel ? _sentinel->next :
nullptr);
241 return !_sentinel || _sentinel->next == _sentinel;
250 for (
auto node = _sentinel->next; node != _sentinel; node = node->next) {
251 std::destroy_at(node);
258 template <
class... Args>
261 emplace_impl(a_pos, std::forward<Args>(a_args)...);
262 return a_pos.
_cur->prev;
267 const auto node = a_pos.
_cur;
268 const auto next = node->next;
269 node->prev->next = next;
270 next->prev = node->prev;
272 node->prev =
nullptr;
273 node->next =
nullptr;
289 template <
class... Args>
292 emplace_back_impl(std::forward<Args>(a_args)...);
306 template <
class... Args>
309 emplace_front_impl(std::forward<Args>(a_args)...);
314 template <
class... Args>
315 inline void emplace_impl(const_iterator a_pos, Args&&... a_args)
322 std::construct_at(node, std::forward<Args>(a_args)...);
323 node->next = a_pos._cur;
324 node->prev = a_pos._cur->prev;
325 a_pos._cur->prev->next = node;
326 a_pos._cur->prev = node;
329 template <
class... Args>
330 inline void emplace_back_impl(Args&&... a_args)
341 std::construct_at(node, std::forward<Args>(a_args)...);
342 node->next = _sentinel;
343 node->prev = _sentinel->prev;
344 _sentinel->prev->next = node;
345 _sentinel->prev = node;
348 template <
class... Args>
349 inline void emplace_front_impl(Args&&... a_args)
360 std::construct_at(node, std::forward<Args>(a_args)...);
361 node->prev = _sentinel;
362 node->next = _sentinel->next;
363 _sentinel->next->prev = node;
364 _sentinel->next = node;
367 inline bool create_list()
371 _sentinel->next = _sentinel;
372 _sentinel->prev = _sentinel;
377 inline void destroy_list()
384 BSTListNode<T>* _sentinel;
void deallocate(BSTListNode< T > *a_node)
Definition: BSTList.h:33
BSTListNode< T > * allocate()
Definition: BSTList.h:28
value_type item
Definition: BSTList.h:21
T value_type
Definition: BSTList.h:11
BSTListNode(Args &&... a_args)
Definition: BSTList.h:14
BSTListNode< T > * next
Definition: BSTList.h:19
BSTListNode< T > * prev
Definition: BSTList.h:20
reference emplace_front(Args &&... a_args)
Definition: BSTList.h:307
const_iterator cend() const
Definition: BSTList.h:234
reference emplace_back(Args &&... a_args)
Definition: BSTList.h:290
void clear()
Definition: BSTList.h:244
BSTList & operator=(const BSTList &)=delete
reference back()
Definition: BSTList.h:199
void push_back(T &&a_value)
Definition: BSTList.h:284
constexpr bool empty() const
Definition: BSTList.h:239
void push_front(const T &a_value)
Definition: BSTList.h:296
constexpr BSTList()
Definition: BSTList.h:171
const T & const_reference
Definition: BSTList.h:46
T & reference
Definition: BSTList.h:45
Allocator allocator_type
Definition: BSTList.h:44
const_reference back() const
Definition: BSTList.h:204
const_iterator cbegin() const
Definition: BSTList.h:219
reference front()
Definition: BSTList.h:189
const_iterator end() const
Definition: BSTList.h:229
const_iterator begin() const
Definition: BSTList.h:214
iterator erase(const_iterator a_pos)
Definition: BSTList.h:265
const_reference front() const
Definition: BSTList.h:194
BSTList(const BSTList &)=delete
iterator end()
Definition: BSTList.h:224
iterator emplace(const_iterator a_pos, Args &&... a_args)
Definition: BSTList.h:259
iterator begin()
Definition: BSTList.h:209
void push_back(const T &a_value)
Definition: BSTList.h:279
void push_front(T &&a_value)
Definition: BSTList.h:301
~BSTList()
Definition: BSTList.h:178
T value_type
Definition: BSTList.h:43
BSTList & operator=(BSTList &&)=delete
BSTList(BSTList &&)=delete
Definition: AbsorbEffect.h:6
T observer
Definition: PCH.h:92
Definition: NiBinaryStream.h:94
constexpr const_reference operator*() const noexcept
Definition: BSTList.h:88
constexpr const_iterator & operator=(const const_iterator &a_rhs) noexcept
Definition: BSTList.h:71
constexpr const_iterator & operator--() noexcept
Definition: BSTList.h:111
std::bidirectional_iterator_tag iterator_category
Definition: BSTList.h:53
constexpr bool operator!=(const const_iterator &a_rhs) const noexcept
Definition: BSTList.h:92
T value_type
Definition: BSTList.h:51
constexpr const_iterator operator++(int) noexcept
Definition: BSTList.h:103
constexpr const_iterator & operator++() noexcept
Definition: BSTList.h:95
constexpr const_iterator(const const_iterator &&a_rhs) noexcept
Definition: BSTList.h:65
constexpr const_iterator operator--(int) noexcept
Definition: BSTList.h:119
stl::observer< BSTListNode< T > * > _cur
Definition: BSTList.h:127
const_iterator(BSTListNode< T > *a_node) noexcept
Definition: BSTList.h:57
constexpr const_iterator(const const_iterator &a_rhs) noexcept
Definition: BSTList.h:61
constexpr bool operator==(const const_iterator &a_rhs) const noexcept
Definition: BSTList.h:91
constexpr const_iterator & operator=(const_iterator &&a_rhs) noexcept
Definition: BSTList.h:79
constexpr const_pointer operator->() const noexcept
Definition: BSTList.h:89
const T * const_pointer
Definition: BSTList.h:52
Definition: BSTList.h:131
constexpr pointer operator->() const noexcept
Definition: BSTList.h:138
T * pointer
Definition: BSTList.h:133
constexpr iterator & operator++() noexcept
Definition: BSTList.h:141
constexpr iterator operator++(int) noexcept
Definition: BSTList.h:148
constexpr iterator & operator--() noexcept
Definition: BSTList.h:156
constexpr iterator operator--(int) noexcept
Definition: BSTList.h:163
constexpr reference operator*() const noexcept
Definition: BSTList.h:137