18 #include <type_traits> 19 #include <initializer_list> 25 namespace containers {
27 template<
typename T,
typename Alloc = std::allocator<T> >
29 template<
typename T,
typename Alloc = std::allocator<T> >
44 #ifdef incompletecpp11 48 this->deallocate(p,1);
51 this->destroy(std::addressof(*p));
52 this->deallocate(p,1);
58 template <
typename Alloc,
typename... Args>
59 typename Alloc::value_type *
63 typedef typename Alloc::pointer
pointer;
65 pointer qq = a.allocate(1);
68 #ifdef incompletecpp11 71 value_type* q=std::addressof(*qq);
73 a.construct(q,std::forward<Args>(args)...);
85 template<
typename T,
typename Alloc = std::allocator<T> >
88 typedef typename Alloc::template rebind<sl_node>::other
alloc_type;
89 typedef std::unique_ptr<sl_node, allocator_deleter<alloc_type> >
link_type;
94 sl_node(
const T& contents) : next(nullptr), contents(contents) {}
95 sl_node(T&& contents) : next(nullptr), contents(std::move(contents)) {}
96 template<
typename... Args>
sl_node(Args&&... args)
97 : next(nullptr), contents(std::forward<Args>(args)...) {}
102 {
while (next.get()!=
nullptr)
103 next.reset(next->next.release());
108 template<
typename T,
typename Alloc = std::allocator<T> >
110 :
public std::iterator<std::forward_iterator_tag, T>
130 : link_loc(const_cast<link_type*>(&link)) {}
133 const T&
operator*()
const {
return (*link_loc)->contents; }
134 const T*
operator->()
const {
return &(*link_loc)->contents; }
136 self operator++() { link_loc = &(*link_loc)->next;
return *
this; }
138 {
self tmp=*
this; link_loc = &(*link_loc)->next;
return tmp; }
141 bool operator==(
const self& x)
const {
return link_loc == x.link_loc; }
142 bool operator!=(
const self& x)
const {
return link_loc != x.link_loc; }
144 bool at_end ()
const {
return *link_loc==
nullptr; }
148 template<
typename T,
typename Alloc = std::allocator<T> >
165 T&
operator*()
const {
return (*Base::link_loc)->contents; }
166 T*
operator->()
const {
return &(*Base::link_loc)->contents; }
171 {
self tmp=*
this; Base::operator++(
nullptr);
return tmp; }
175 template<
typename T,
typename Alloc = std::allocator<T> >
177 :
public std::iterator<std::forward_iterator_tag, T>
195 : link(const_cast<link_type>(p)) {}
203 {
self tmp=*
this; link = link->
next.get();
return tmp; }
206 bool operator==(
const self& x)
const {
return link == x.link; }
207 bool operator!=(
const self& x)
const {
return link != x.link; }
209 bool at_end ()
const {
return link==
nullptr; }
216 template<
typename T,
typename Alloc = std::allocator<T> >
234 self operator++() { Base::link = Base::link->next.get();
return *
this; }
236 {
self tmp=*
this; Base::link = Base::link->next.get();
return tmp; }
246 template<
typename T,
typename Alloc>
248 :
private Alloc::template rebind<sl_node<T, Alloc> >::other
253 typedef typename Alloc::template rebind<node_type>::other
alloc_type;
255 typedef std::unique_ptr<node_type, allocator_deleter<alloc_type> >
link_type;
280 : alloc_type(), head(nullptr) {}
283 : alloc_type(a), head(nullptr) {}
286 : alloc_type(std::move(a)), head(nullptr) {}
289 : alloc_type(), head(raw) {}
292 : alloc_type(a), head(raw) {}
295 : alloc_type(std::move(a)), head(raw) {}
301 link_type* tail = &head;
302 for (node_type*
p=x.
head.get();
p!=
nullptr;
p=
p->next.get())
311 : alloc_type(std::move(x)), head(x.head.release())
314 template<
typename InputIt,
typename =
typename std::enable_if<
315 std::is_base_of<std::input_iterator_tag,
316 typename std::iterator_traits<InputIt>::iterator_category
318 simple_list (InputIt first, InputIt last,
const alloc_type& a=alloc_type())
319 : alloc_type(a), head(nullptr)
325 : alloc_type(a), head(nullptr)
331 p->
next = std::move(head);
336 simple_list (size_type n,
const T& x,
const alloc_type& a=alloc_type())
337 : alloc_type(a), head(nullptr)
342 simple_list (std::initializer_list<T> l,
const alloc_type& a=alloc_type())
343 : alloc_type(a), head(nullptr)
345 assign(l.begin(),l.end());
354 iterator
p = begin();
355 node_type* q=x.
head.get();
362 for ( ; not at_end(p) and q!=
nullptr; ++
p, q=q->
next.get())
366 for ( ; q!=
nullptr; ++
p, q=q->next.get())
367 p.link_loc->reset(
allocator_new(node_allocator(),q->contents));
376 if (get_node_allocator() == x.get_node_allocator() )
379 head = std::move(x.head);
381 node_allocator() = std::move(x.node_allocator());
385 iterator
p = begin();
386 node_type* q=x.head.get();
387 for ( ; not at_end(p) and q!=
nullptr; ++
p, q=q->
next.get())
388 *p = std::move(q->contents);
390 for ( ; q!=
nullptr; ++
p, q=q->next.get())
403 head.swap(other.
head);
409 iterator
p=begin(), q=other.
begin();
411 for ( ; not (at_end(p)
or at_end(q)); ++
p,++q)
414 while (not at_end(q))
420 while (not at_end(p))
422 other.
insert(q,std::move(*p));
428 node_type*
release() {
return head.release(); }
435 iterator
begin() {
return iterator(head); }
436 weak_iterator
wbegin() {
return weak_iterator(head.get()); }
438 T&
front () {
return head->contents; }
440 { head.reset(head->next.release()); }
446 p->
next.reset(head.release());
454 p->
next.reset(head.release());
458 template<
typename... Args>
464 p->
next.reset(head.release());
468 bool empty ()
const {
return head.get()==
nullptr; }
471 iterator
insert (const_iterator pos,
const T& val)
476 p->
next.reset(link.release());
478 return iterator(link);
481 iterator
insert (const_iterator pos, T&& val)
486 p->
next.reset(link.release());
488 return iterator(link);
491 iterator
insert (const_iterator pos, size_type n,
const T& val)
498 template<
typename InputIt,
typename =
typename std::enable_if<
499 std::is_base_of<std::input_iterator_tag,
500 typename std::iterator_traits<InputIt>::iterator_category
502 iterator
insert (const_iterator pos, InputIt first, InputIt last)
505 for( ; first!=last; ++first,++pos)
518 *pos.
link_loc = std::move(other.head);
528 link.reset(link->next.release());
529 return iterator(link);
532 iterator
erase (const_iterator first, const_iterator last)
535 while (link.get()!=
end)
536 link.reset(link->next.release());
537 return iterator(link);
547 iterator
p = begin();
548 for ( ; not at_end(p) and n-->0; ++
p)
558 template<
typename InputIt,
typename =
typename std::enable_if<
559 std::is_base_of<std::input_iterator_tag,
560 typename std::iterator_traits<InputIt>::iterator_category
562 void assign (InputIt first, InputIt last)
564 iterator
p = begin();
565 for ( ; not at_end(p) and first!=last; ++
p,++first)
569 for ( ; first!=last; ++
p,++first)
575 template<
typename InputIt>
578 iterator
p = begin();
579 for ( ; not at_end(p) and first!=last; ++
p,++first)
580 *p = std::move(*first);
583 for ( ; first!=last; ++
p,++first)
584 p.link_loc->reset(
allocator_new(node_allocator(),std::move(*first)));
591 link_type result(
nullptr);
592 while (head!=
nullptr)
594 result.swap(head->next);
597 head=std::move(result);
600 void reverse (const_iterator from, const_iterator to)
604 while (
p.get()!=
nullptr)
613 const T&
front ()
const {
return head->contents; }
614 const_iterator
begin ()
const {
return const_iterator(head); }
615 const_iterator
cbegin ()
const {
return const_iterator(head); }
617 {
return weak_const_iterator(head.get()); }
619 {
return weak_const_iterator(head.get()); }
629 template<
typename T,
typename Alloc>
639 template<
typename T,
typename Alloc>
643 for (; l!=
nullptr; l=l->
next.get())
648 template<
typename T,
typename Alloc>
658 template<
typename T,
typename Alloc>
663 template<
typename T,
typename Alloc>
673 template<
typename T,
typename Alloc>
682 template<
typename T,
typename Alloc>
684 :
private Alloc::template rebind<sl_node<T, Alloc> >::other
687 typedef typename Alloc::template rebind<node_type>::other
alloc_type;
689 typedef std::unique_ptr<node_type, allocator_deleter<alloc_type> >
link_type;
719 : tail(tail), dst(p.link_loc) {}
721 {
if (dst->get()==
nullptr)
729 : alloc_type(), head(nullptr), tail(&head), node_count(0) {}
732 : alloc_type(a), head(nullptr), tail(&head), node_count(0) {}
735 : alloc_type(a), head(nullptr), tail(&head), node_count(0) {}
741 , node_count(x.node_count)
743 for (node_type*
p=x.
head.get();
p!=
nullptr;
p=
p->next.get())
752 : alloc_type(std::move(x))
753 , head(x.head.release())
754 , tail(x.
empty() ? &head : x.tail)
755 , node_count(x.node_count)
759 : alloc_type(std::move(x))
760 , head(x.head.release())
764 for ( ; *tail!=
nullptr; tail=&(*tail)->next)
768 template<
typename InputIt,
typename =
typename std::enable_if<
769 std::is_base_of<std::input_iterator_tag,
770 typename std::iterator_traits<InputIt>::iterator_category
772 sl_list (InputIt first, InputIt last,
const alloc_type& a=alloc_type())
773 : alloc_type(a), head(nullptr), tail(&head), node_count(0)
778 sl_list (size_type n,
const alloc_type& a=alloc_type())
779 : alloc_type(a), head(nullptr), tail(&head), node_count(n)
790 sl_list (size_type n,
const T& x,
const alloc_type& a=alloc_type())
791 : alloc_type(a), head(nullptr), tail(&head), node_count(n)
796 sl_list (std::initializer_list<T> l,
const alloc_type& a=alloc_type())
797 : alloc_type(a), head(nullptr), tail(&head), node_count(0)
799 assign(l.begin(),l.end());
820 if (get_node_allocator() == x.get_node_allocator() )
823 if (x.head.get()==
nullptr)
827 head = std::move(x.head);
829 node_count = x.node_count;
832 node_allocator() = std::move(x.node_allocator());
835 move_assign(x.begin(),x.end());
845 head.swap(other.
head);
849 if (head.get()==
nullptr)
851 if (other.
head.get()==
nullptr)
856 iterator
p=begin(), q=other.
begin();
858 for ( ; p!=
end() and q!=other.
end(); ++
p,++q)
872 iterator
begin () {
return iterator(head); }
873 iterator
end () {
return iterator(*tail); }
874 weak_iterator
wbegin () {
return weak_iterator(head.get()); }
875 weak_iterator
wend () {
return weak_iterator(
nullptr); }
877 T&
front () {
return head->contents; }
880 head.reset(head->next.release());
882 if (head.get()==
nullptr)
890 if (head.get()==
nullptr)
893 p->
next.reset(head.release());
902 if (head.get()==
nullptr)
905 p->
next.reset(head.release());
910 template<
typename... Args>
916 if (head.get()==
nullptr)
919 p->
next.reset(head.release());
926 link_type& last = *tail;
931 return iterator(last);
936 link_type& last = *tail;
941 return iterator(last);
944 template<
typename... Args>
947 link_type& last = *tail;
954 return iterator(last);
957 bool empty ()
const {
return tail==&head; }
959 size_type
size ()
const {
return node_count; }
961 iterator
insert (const_iterator pos,
const T& val)
968 p->
next.reset(link.release());
971 return iterator(link);
974 iterator
insert (const_iterator pos, T&& val)
981 p->
next.reset(link.release());
984 return iterator(link);
987 iterator
insert (const_iterator pos, size_type n,
const T& val)
996 p->
next.reset(link.release());
1001 return iterator(link);
1004 template<
typename InputIt,
typename =
typename std::enable_if<
1005 std::is_base_of<std::input_iterator_tag,
1006 typename std::iterator_traits<InputIt>::iterator_category
1008 iterator
insert (const_iterator pos, InputIt first, InputIt last)
1010 ensure me(tail,pos);
1011 for( ; first!=last; ++first)
1016 pos = iterator(p->
next);
1021 template<
typename InputIt>
1024 ensure me(tail,pos);
1025 for( ; first!=last; ++first)
1027 node_type*
p =
allocator_new(node_allocator(),std::move(*first));
1030 pos = iterator(p->
next);
1038 link.reset(link->next.release());
1039 if (link.get()==
nullptr)
1042 return iterator(link);
1045 iterator
erase (const_iterator first, const_iterator last)
1046 {
const node_type* end_ptr =
1049 while (link.get()!=end_ptr)
1051 link.reset(link->next.release());
1054 if (end_ptr==
nullptr)
1056 return iterator(link);
1060 {
if (not other.empty())
1061 { *tail = std::move(other.head);
1063 node_count += other.node_count;
1069 {
if (other.empty())
1071 link_type&
final = *other.tail;
1076 final = std::move(link);
1077 link = std::move(other.head);
1078 node_count += other.node_count;
1080 return iterator(
final);
1091 const size_type given_n =
n;
1092 iterator
p = begin();
1093 for ( ; p!=
end() and n-->0; ++
p)
1100 (tail = p.link_loc)->reset();
1101 node_count = given_n;
1105 template<
typename InputIt,
typename =
typename std::enable_if<
1106 std::is_base_of<std::input_iterator_tag,
1107 typename std::iterator_traits<InputIt>::iterator_category
1112 iterator
p = begin();
1113 for ( ; p!=
end() and first!=last; ++
p,++first,++count)
1120 (tail = p.link_loc)->reset();
1125 template<
typename InputIt>
1129 iterator
p = begin();
1130 for ( ; p!=
end() and first!=last; ++
p,++first,++count)
1131 *p = std::move(*first);
1134 move_insert(p,first,last);
1137 (tail = p.link_loc)->reset();
1144 void reverse (const_iterator from, const_iterator to)
1146 if (to==
end() and from!=to)
1148 link_type result((*to.
link_loc).release());
1149 link_type
p((*from.
link_loc).release());
1150 while (
p.get()!=
nullptr)
1152 result.swap(
p->next);
1155 from.
link_loc->reset(result.release());
1164 const T&
front ()
const {
return head->contents; }
1165 const_iterator
begin ()
const {
return const_iterator(head); }
1166 const_iterator
end ()
const {
return const_iterator(*tail); }
1167 const_iterator
cbegin ()
const {
return const_iterator(head); }
1168 const_iterator
cend ()
const {
return const_iterator(*tail); }
1170 {
return weak_const_iterator(head.get()); }
1172 {
return weak_const_iterator(head.get()); }
1173 weak_const_iterator
wend ()
const {
return weak_const_iterator(
nullptr); }
1174 weak_const_iterator
wcend ()
const {
return weak_const_iterator(
nullptr); }
1183 template<
typename T,
typename Alloc>
1186 template<
typename T,
typename Alloc>
1190 template<
typename T,
typename Alloc>
1194 template<
typename T,
typename Alloc>
1199 template<
typename T,
typename Alloc>
1203 template<
typename T,
typename Alloc = std::allocator<T> >
1209 typedef typename Alloc::template rebind<node_type>::other
alloc_type;
1221 : Base(std::move(x)) {}
1226 template<
typename InputIt,
typename =
typename std::enable_if<
1227 std::is_base_of<std::input_iterator_tag,
1228 typename std::iterator_traits<InputIt>::iterator_category
1231 const alloc_type& a=alloc_type())
1234 for ( ; first!=last; ++first)
1235 Base::push_front(*first);
1239 const alloc_type& a=alloc_type())
1244 { Base::push_front(std::forward<Args>(args)...); }
1245 template<
typename... Args>
void pop_back(Args&&... args)
1246 { Base::pop_front(std::forward<Args>(args)...); }
1248 { Base::emplace_front(std::forward<Args>(args)...); }
1250 template<
typename... Args>
const T&
back(Args&&... args)
const 1251 {
return Base::front(std::forward<Args>(args)...); }
1252 template<
typename... Args> T&
back(Args&&... args)
1253 {
return Base::front(std::forward<Args>(args)...); }
1257 template<
typename T,
typename Alloc = std::allocator<T> >
1263 typedef typename Alloc::template rebind<node_type>::other
alloc_type;
1273 : Base(std::move(x)) {}
1278 template<
typename InputIt,
typename =
typename std::enable_if<
1279 std::is_base_of<std::input_iterator_tag,
1280 typename std::iterator_traits<InputIt>::iterator_category
1283 const alloc_type& a=alloc_type())
1286 for ( ; first!=last; ++first)
1291 const alloc_type& a=alloc_type())
1296 { Base::push_front(std::forward<Args>(args)...); }
1297 template<
typename... Args>
void pop_back(Args&&... args)
1298 { Base::pop_front(std::forward<Args>(args)...); }
1300 { Base::emplace_front(std::forward<Args>(args)...); }
1302 template<
typename... Args>
const T&
back(Args&&... args)
const 1303 {
return Base::front(std::forward<Args>(args)...); }
1304 template<
typename... Args> T&
back(Args&&... args)
1305 {
return Base::front(std::forward<Args>(args)...); }
1308 template<
typename... Args>
1310 {
return Base::push_back(std::forward<Args>(args)...); }
1311 template<
typename... Args>
1313 {
return Base::emplace_back(std::forward<Args>(args)...); }
sl_node(T &&contents)
Definition: sl_list.h:95
const value_type & const_reference
Definition: sl_list.h:696
weak_sl_list_const_iterator< T, Alloc > weak_const_iterator
Definition: sl_list.h:270
weak_iterator wbegin()
Definition: sl_list.h:436
iterator insert(const_iterator pos, InputIt first, InputIt last)
Definition: sl_list.h:1008
mirrored_sl_list(Base &&x)
Definition: sl_list.h:1272
Definition: sl_list.h:714
mirrored_simple_list(InputIt first, InputIt last, const alloc_type &a=alloc_type())
Definition: sl_list.h:1230
Denom_t remainder(I, Denom_t)
Definition: arithmetic.h:184
weak_sl_list_const_iterator< T, Alloc > weak_const_iterator
Definition: sl_list.h:702
sl_list(const sl_list &x)
Definition: sl_list.h:737
self operator++()
Definition: sl_list.h:234
T & operator*() const
Definition: sl_list.h:231
std::size_t size_type
Definition: sl_list.h:693
iterator push_back(T &&val)
Definition: sl_list.h:934
mirrored_sl_list(Alloc &&a)
Definition: sl_list.h:1269
simple_list(size_type n, const alloc_type &a=alloc_type())
Definition: sl_list.h:324
bool at_end() const
Definition: sl_list.h:209
simple_list()
Definition: sl_list.h:279
void pop_back(Args &&...args)
Definition: sl_list.h:1245
T & operator*() const
Definition: sl_list.h:165
void clear()
Definition: sl_list.h:540
simple_list(const alloc_type &a)
Definition: sl_list.h:282
T value_type
Definition: sl_list.h:692
~sl_node()
Definition: sl_list.h:101
mirrored_simple_list(typename Base::size_type n, const T &x, const alloc_type &a=alloc_type())
Definition: sl_list.h:1238
bool operator!=(const self &x) const
Definition: sl_list.h:142
Alloc::template rebind< node_type >::other alloc_type
Definition: sl_list.h:1263
iterator erase(const_iterator first, const_iterator last)
Definition: sl_list.h:1045
weak_sl_list_iterator(typename Base::link_type p)
Definition: sl_list.h:228
simple_list(node_type *raw, const alloc_type &a)
Definition: sl_list.h:291
sl_list_const_iterator()
Definition: sl_list.h:126
Definition: sl_list.h:1258
simple_list< T, Alloc > undress()
Definition: sl_list.h:1158
const_iterator cbegin() const
Definition: sl_list.h:615
iterator begin()
Definition: sl_list.h:872
weak_sl_list_const_iterator(const_link_type p)
Definition: sl_list.h:192
void clear()
Definition: sl_list.h:1083
void append(sl_list &&other)
Definition: sl_list.h:1059
sl_list(InputIt first, InputIt last, const alloc_type &a=alloc_type())
Definition: sl_list.h:772
void assign(size_type n, const T &x)
Definition: sl_list.h:545
void swap(sl_list< T, Alloc > &x, sl_list< T, Alloc > &y)
Definition: sl_list.h:1200
uA p
Definition: lists.cpp:26
simple_list(simple_list &&x)
Definition: sl_list.h:310
T value_type
Definition: sl_list.h:260
sl_list(simple_list< T, Alloc > &&x)
Definition: sl_list.h:758
bool empty() const
Definition: sl_list.h:468
void operator()(pointer p)
Definition: sl_list.h:42
void reverse(const_iterator from, const_iterator to)
Definition: sl_list.h:600
Base::iterator push_front(Args &&...args)
Definition: sl_list.h:1309
void pop_back(Args &&...args)
Definition: sl_list.h:1297
simple_list(size_type n, const T &x, const alloc_type &a=alloc_type())
Definition: sl_list.h:336
iterator insert(const_iterator pos, size_type n, const T &val)
Definition: sl_list.h:491
void pop_front()
Definition: sl_list.h:878
void swap(simple_list &other)
Definition: sl_list.h:399
Alloc::pointer node_ptr
Definition: sl_list.h:254
sl_list(std::initializer_list< T > l, const alloc_type &a=alloc_type())
Definition: sl_list.h:796
weak_sl_list_iterator< T, Alloc > weak_iterator
Definition: sl_list.h:703
self operator++()
Definition: sl_list.h:201
sl_list(sl_list &&x)
Definition: sl_list.h:751
simple_list(std::initializer_list< T > l, const alloc_type &a=alloc_type())
Definition: sl_list.h:342
weak_const_iterator wbegin() const
Definition: sl_list.h:1169
mirrored_sl_list(InputIt first, InputIt last, const alloc_type &a=alloc_type())
Definition: sl_list.h:1282
Alloc::value_type * allocator_new(Alloc &a, Args &&...args)
Definition: sl_list.h:60
value_base * value
Definition: axis-types.h:129
static bool at_end(const_iterator p)
Definition: sl_list.h:1177
Alloc::pointer pointer
Definition: sl_list.h:38
void push_front(const T &val)
Definition: sl_list.h:442
weak_iterator wbegin()
Definition: sl_list.h:874
const T & back(Args &&...args) const
Definition: sl_list.h:1250
simple_list(InputIt first, InputIt last, const alloc_type &a=alloc_type())
Definition: sl_list.h:318
~simple_list()
Definition: sl_list.h:348
mirrored_simple_list(Alloc &&a)
Definition: sl_list.h:1216
sl_list_iterator< T, Alloc > iterator
Definition: sl_list.h:701
size_type size() const
Definition: sl_list.h:959
void swap(simple_list< T, Alloc > &x, simple_list< T, Alloc > &y)
Definition: sl_list.h:674
T contents
Definition: sl_list.h:92
sl_node< T, Alloc >::link_type link_type
Definition: sl_list.h:116
value_type & reference
Definition: sl_list.h:263
iterator insert(const_iterator pos, InputIt first, InputIt last)
Definition: sl_list.h:502
mirrored_sl_list(const Alloc &a)
Definition: sl_list.h:1268
void assign(InputIt first, InputIt last)
Definition: sl_list.h:562
iterator insert(const_iterator pos, const T &val)
Definition: sl_list.h:471
self operator++()
Definition: sl_list.h:136
value_type * pointer
Definition: sl_list.h:697
void emplace_front(Args &&...args)
Definition: sl_list.h:459
mirrored_simple_list(Base &&x)
Definition: sl_list.h:1220
bool singleton() const
Definition: sl_list.h:958
sl_list_iterator< T, Alloc > iterator
Definition: sl_list.h:269
Alloc::template rebind< node_type >::other alloc_type
Definition: sl_list.h:1209
void reverse()
Definition: sl_list.h:589
static bool at_end(const_iterator p)
Definition: sl_list.h:621
iterator insert(const_iterator pos, size_type n, const T &val)
Definition: sl_list.h:987
mirrored_simple_list(const Alloc &a)
Definition: sl_list.h:1215
sl_node< T, Alloc > node_type
Definition: sl_list.h:1208
iterator insert(const_iterator pos, const T &val)
Definition: sl_list.h:961
std::unique_ptr< node_type, allocator_deleter< alloc_type > > link_type
Definition: sl_list.h:689
weak_const_iterator wcend() const
Definition: sl_list.h:1174
iterator end()
Definition: sl_list.h:873
link_type link
Definition: sl_list.h:187
const T * operator->() const
Definition: sl_list.h:134
sl_list_iterator(typename Base::link_type &link)
Definition: sl_list.h:162
Alloc::pointer node_ptr
Definition: sl_list.h:688
const value_type * const_pointer
Definition: sl_list.h:266
std::size_t size_type
Definition: sl_list.h:261
sl_node(const T &contents)
Definition: sl_list.h:94
sl_list(const alloc_type &a)
Definition: sl_list.h:731
void emplace_front(Args &&...args)
Definition: sl_list.h:911
Alloc::value_type value_type
Definition: sl_list.h:37
simple_list< T, Alloc > Base
Definition: sl_list.h:1207
mirrored_simple_list(sl_node< T, Alloc > *raw_list)
Definition: sl_list.h:1222
mirrored_sl_list()
Definition: sl_list.h:1267
Definition: sl_list.h:1204
T & back(Args &&...args)
Definition: sl_list.h:1304
bool operator==(const self &x) const
Definition: sl_list.h:141
const T * operator->() const
Definition: sl_list.h:199
void reverse()
Definition: sl_list.h:1142
Alloc::template rebind< sl_node >::other alloc_type
Definition: sl_list.h:88
weak_iterator wend()
Definition: sl_list.h:875
weak_sl_list_iterator()
Definition: sl_list.h:227
std::ptrdiff_t difference_type
Definition: sl_list.h:694
constexpr allocator_deleter()=default
iterator erase(const_iterator pos)
Definition: sl_list.h:1035
self operator++(int)
Definition: sl_list.h:235
self operator++(int)
Definition: sl_list.h:202
bool operator!=(const self &x) const
Definition: sl_list.h:207
sl_list_const_iterator< T, Alloc > const_iterator
Definition: sl_list.h:700
sl_node< T, Alloc > node_type
Definition: sl_list.h:1262
void assign(InputIt first, InputIt last)
Definition: sl_list.h:1109
iterator splice(const_iterator pos, simple_list &&other)
Definition: sl_list.h:516
iterator erase(const_iterator first, const_iterator last)
Definition: sl_list.h:532
alloc_type & node_allocator()
Definition: sl_list.h:432
weak_sl_list_const_iterator< T, Alloc > Base
Definition: sl_list.h:220
mirrored_sl_list(sl_node< T, Alloc > *raw_list)
Definition: sl_list.h:1274
void pop_front()
Definition: sl_list.h:439
const_iterator begin() const
Definition: sl_list.h:1165
void swap(sl_list &other)
Definition: sl_list.h:839
void push_back(Args &&...args)
Definition: sl_list.h:1295
const alloc_type & get_node_allocator() const
Definition: sl_list.h:431
value_type & reference
Definition: sl_list.h:695
Definition: sl_list.h:107
bool operator==(const self &x) const
Definition: sl_list.h:206
T & back(Args &&...args)
Definition: sl_list.h:1252
~ensure()
Definition: sl_list.h:720
void emplace_back(Args &&...args)
Definition: sl_list.h:1299
const_iterator cbegin() const
Definition: sl_list.h:1167
iterator insert(const_iterator pos, T &&val)
Definition: sl_list.h:974
Alloc::template rebind< node_type >::other alloc_type
Definition: sl_list.h:253
sl_list_const_iterator< T, Alloc > Base
Definition: sl_list.h:154
void move_assign(InputIt first, InputIt last)
Definition: sl_list.h:576
const T & front() const
Definition: sl_list.h:1164
weak_const_iterator wcbegin() const
Definition: sl_list.h:1171
void push_front(T &&val)
Definition: sl_list.h:898
iterator push_back(const T &val)
Definition: sl_list.h:924
mirrored_simple_list()
Definition: sl_list.h:1214
iterator insert(const_iterator pos, T &&val)
Definition: sl_list.h:481
link_type *& tail
Definition: sl_list.h:715
void push_front(T &&val)
Definition: sl_list.h:450
void assign(size_type n, const T &x)
Definition: sl_list.h:1089
const T & operator*() const
Definition: sl_list.h:198
size_t length(const simple_list< T, Alloc > &l)
Definition: sl_list.h:630
Alloc::template rebind< node_type >::other alloc_type
Definition: sl_list.h:687
simple_list(node_type *raw, alloc_type &&a)
Definition: sl_list.h:294
Definition: sl_list.h:174
weak_const_iterator wend() const
Definition: sl_list.h:1173
iterator begin()
Definition: sl_list.h:435
mirrored_sl_list(const Base &x)
Definition: sl_list.h:1270
weak_sl_list_iterator< T, Alloc > weak_iterator
Definition: sl_list.h:271
link_type head
Definition: sl_list.h:707
~sl_list()
Definition: sl_list.h:802
void set_empty()
Definition: sl_list.h:712
size_type node_count
Definition: sl_list.h:709
bool at_end() const
Definition: sl_list.h:144
void push_front(const T &val)
Definition: sl_list.h:886
const_iterator begin() const
Definition: sl_list.h:614
const_iterator end() const
Definition: sl_list.h:1166
T * operator->() const
Definition: sl_list.h:166
sl_list(alloc_type &&a)
Definition: sl_list.h:734
sl_node< T, Alloc > node_type
Definition: sl_list.h:252
static bool at_end(weak_const_iterator p)
Definition: sl_list.h:622
std::unique_ptr< sl_node, allocator_deleter< alloc_type > > link_type
Definition: sl_list.h:89
value_type * pointer
Definition: sl_list.h:265
const alloc_type & get_node_allocator() const
Definition: sl_list.h:868
Base::iterator emplace_front(Args &&...args)
Definition: sl_list.h:1312
weak_const_iterator wcbegin() const
Definition: sl_list.h:618
link_type *& dst
Definition: sl_list.h:716
sl_list(size_type n, const T &x, const alloc_type &a=alloc_type())
Definition: sl_list.h:790
void move_assign(InputIt first, InputIt last)
Definition: sl_list.h:1126
weak_const_iterator wbegin() const
Definition: sl_list.h:616
simple_list(const simple_list &x)
Definition: sl_list.h:297
sl_list_const_iterator(const link_type &link)
Definition: sl_list.h:127
link_type head
Definition: sl_list.h:275
sl_node(Args &&...args)
Definition: sl_list.h:96
alloc_type & node_allocator()
Definition: sl_list.h:869
sl_list_iterator()
Definition: sl_list.h:161
simple_list< T, Alloc >::const_iterator cend(const simple_list< T, Alloc > &l)
Definition: sl_list.h:660
Definition: sl_list.h:109
weak_sl_list_const_iterator()
Definition: sl_list.h:191
T * operator->() const
Definition: sl_list.h:232
const value_type * const_pointer
Definition: sl_list.h:698
void push_back(Args &&...args)
Definition: sl_list.h:1243
std::unique_ptr< node_type, allocator_deleter< alloc_type > > link_type
Definition: sl_list.h:255
unsigned long n
Definition: axis.cpp:77
sl_list< T, Alloc > Base
Definition: sl_list.h:1261
simple_list< T, Alloc >::const_iterator end(const simple_list< T, Alloc > &l)
Definition: sl_list.h:650
bool singleton() const
Definition: sl_list.h:469
sl_node< T, Alloc > node_type
Definition: sl_list.h:686
sl_list()
Definition: sl_list.h:728
sl_node< T, Alloc > * link_type
Definition: sl_list.h:180
simple_list(node_type *raw)
Definition: sl_list.h:288
void move_insert(const_iterator pos, InputIt first, InputIt last)
Definition: sl_list.h:1022
std::ptrdiff_t difference_type
Definition: sl_list.h:262
link_type next
Definition: sl_list.h:91
iterator erase(const_iterator pos)
Definition: sl_list.h:526
link_type * tail
Definition: sl_list.h:708
T & front()
Definition: sl_list.h:877
static bool at_end(weak_const_iterator p)
Definition: sl_list.h:1178
Definition: sl_list.h:176
mirrored_simple_list(const Base &x)
Definition: sl_list.h:1218
void emplace_back(Args &&...args)
Definition: sl_list.h:1247
self operator++()
Definition: sl_list.h:169
link_type * link_loc
Definition: sl_list.h:122
sl_list(size_type n, const alloc_type &a=alloc_type())
Definition: sl_list.h:778
T & front()
Definition: sl_list.h:438
sl_list_const_iterator< T, Alloc > const_iterator
Definition: sl_list.h:268
ensure(link_type *&tail, const_iterator &p)
Definition: sl_list.h:718
const_iterator cend() const
Definition: sl_list.h:1168
const T & operator*() const
Definition: sl_list.h:133
void reverse(const_iterator from, const_iterator to)
Definition: sl_list.h:1144
self operator++(int)
Definition: sl_list.h:170
simple_list(alloc_type &&a)
Definition: sl_list.h:285
const value_type & const_reference
Definition: sl_list.h:264
const T & front() const
Definition: sl_list.h:613
iterator splice(const_iterator pos, sl_list &&other)
Definition: sl_list.h:1068
iterator emplace_back(Args &&...args)
Definition: sl_list.h:945
mirrored_sl_list(typename Base::size_type n, const T &x, const alloc_type &a=alloc_type())
Definition: sl_list.h:1290
const sl_node< T, Alloc > * const_link_type
Definition: sl_list.h:181
bool empty() const
Definition: sl_list.h:957
const T & back(Args &&...args) const
Definition: sl_list.h:1302
self operator++(int)
Definition: sl_list.h:137
node_type * release()
Definition: sl_list.h:428
const bool empty
Definition: axis.cpp:43