14#include "../type_traits"
16namespace cxx {
namespace Bits {
27template <
typename T,
typename STORE_T>
31 using Storage_type = STORE_T;
46template <
typename ITEM>
49 using Value_type =
typename ITEM::Value_type;
50 using Next_type =
typename ITEM::Storage_type;
56 Iterator() : _c(
nullptr) {}
58 Value_type *operator * ()
const {
return _c; }
59 Value_type *operator -> ()
const {
return _c; }
61 Iterator operator ++ ()
67 bool operator == (Iterator
const &o)
const {
return _c == o._c; }
68 bool operator != (Iterator
const &o)
const {
return !operator == (o); }
73 explicit Iterator(Value_type *i) : _c(i) {}
81 Const_iterator() : _c(
nullptr) {}
83 Value_type
const *operator * ()
const {
return _c; }
84 Value_type
const *operator -> ()
const {
return _c; }
86 Const_iterator operator ++ ()
92 bool operator == (Const_iterator
const &o)
const {
return _c == o._c; }
93 bool operator != (Const_iterator
const &o)
const {
return !operator == (o); }
98 explicit Const_iterator(Value_type
const *i) : _c(i) {}
100 Value_type
const *_c;
108 e->_n = cxx::move(this->_f);
109 this->_f = cxx::move(e);
118 e->_n = cxx::move(this->_f);
152 Next_type ret = cxx::move(_f);
155 _f = cxx::move(ret->_n);
167 Iterator begin() {
return Iterator(_f.get()); }
168 Iterator end() {
return Iterator(); }
170 Const_iterator begin()
const {
return Const_iterator(_f.get()); }
171 Const_iterator end()
const {
return Const_iterator(); }
173 Const_iterator cbegin()
const {
return const_iterator(_f.get()); }
174 Const_iterator cend()
const {
return Const_iterator(); }
List item for an arbitrary item in a Smart_ptr_list.
List of smart-pointer-managed objects.
Value_type * front() const
Return a pointer to the first element in the list.
Next_type pop_front()
Remove the element in front of the list and return it.
bool empty() const
Check if the list is empty.
void push_front(Next_type &&e)
Add an element to the front of the list.
void push_front(Next_type const &e)
Add an element to the front of the list.
void push_back(Next_type &&e)
Add an element at the end of the list.
void push_back(Next_type const &e)
Add an element at the end of the list.