1*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
2*0a6a1f1dSLionel Sambuc //
3*0a6a1f1dSLionel Sambuc // The LLVM Compiler Infrastructure
4*0a6a1f1dSLionel Sambuc //
5*0a6a1f1dSLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*0a6a1f1dSLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*0a6a1f1dSLionel Sambuc //
8*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuc #ifndef NASTY_VECTOR_H
11*0a6a1f1dSLionel Sambuc #define NASTY_VECTOR_H
12*0a6a1f1dSLionel Sambuc
13*0a6a1f1dSLionel Sambuc #include <vector>
14*0a6a1f1dSLionel Sambuc #include <list>
15*0a6a1f1dSLionel Sambuc
16*0a6a1f1dSLionel Sambuc template <class T>
17*0a6a1f1dSLionel Sambuc class nasty_vector
18*0a6a1f1dSLionel Sambuc {
19*0a6a1f1dSLionel Sambuc public:
20*0a6a1f1dSLionel Sambuc typedef typename std::vector<T> nested_container;
21*0a6a1f1dSLionel Sambuc typedef typename nested_container::value_type value_type;
22*0a6a1f1dSLionel Sambuc typedef typename nested_container::reference reference;
23*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_reference const_reference;
24*0a6a1f1dSLionel Sambuc typedef typename nested_container::iterator iterator;
25*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_iterator const_iterator;
26*0a6a1f1dSLionel Sambuc
27*0a6a1f1dSLionel Sambuc typedef typename nested_container::size_type size_type;
28*0a6a1f1dSLionel Sambuc typedef typename nested_container::difference_type difference_type;
29*0a6a1f1dSLionel Sambuc typedef typename nested_container::pointer pointer;
30*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_pointer const_pointer;
31*0a6a1f1dSLionel Sambuc
32*0a6a1f1dSLionel Sambuc typedef typename nested_container::reverse_iterator reverse_iterator;
33*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_reverse_iterator const_reverse_iterator;
34*0a6a1f1dSLionel Sambuc
nasty_vector()35*0a6a1f1dSLionel Sambuc nasty_vector() : v_() {}
nasty_vector(size_type n)36*0a6a1f1dSLionel Sambuc explicit nasty_vector(size_type n) : v_(n) {}
nasty_vector(size_type n,const value_type & value)37*0a6a1f1dSLionel Sambuc nasty_vector(size_type n, const value_type& value) : v_(n, value) {}
nasty_vector(InputIterator first,InputIterator last)38*0a6a1f1dSLionel Sambuc template <class InputIterator> nasty_vector(InputIterator first, InputIterator last) : v_(first, last) {}
39*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
nasty_vector(std::initializer_list<value_type> il)40*0a6a1f1dSLionel Sambuc nasty_vector(std::initializer_list<value_type> il) : v_(il) {}
41*0a6a1f1dSLionel Sambuc #endif
~nasty_vector()42*0a6a1f1dSLionel Sambuc ~nasty_vector() {}
43*0a6a1f1dSLionel Sambuc
44*0a6a1f1dSLionel Sambuc template <class InputIterator>
assign(InputIterator first,InputIterator last)45*0a6a1f1dSLionel Sambuc void assign(InputIterator first, InputIterator last) { v_.assign(first, last); }
assign(size_type n,const value_type & u)46*0a6a1f1dSLionel Sambuc void assign(size_type n, const value_type& u) { v_.assign(n, u); }
47*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
assign(std::initializer_list<value_type> il)48*0a6a1f1dSLionel Sambuc void assign(std::initializer_list<value_type> il) { v_.assign(il); }
49*0a6a1f1dSLionel Sambuc #endif
50*0a6a1f1dSLionel Sambuc
begin()51*0a6a1f1dSLionel Sambuc iterator begin() _NOEXCEPT { return v_.begin(); }
begin() const52*0a6a1f1dSLionel Sambuc const_iterator begin() const _NOEXCEPT { return v_.begin(); }
end()53*0a6a1f1dSLionel Sambuc iterator end() _NOEXCEPT { return v_.end(); }
end() const54*0a6a1f1dSLionel Sambuc const_iterator end() const _NOEXCEPT { return v_.end(); }
55*0a6a1f1dSLionel Sambuc
rbegin()56*0a6a1f1dSLionel Sambuc reverse_iterator rbegin() _NOEXCEPT { return v_.rbegin(); }
rbegin() const57*0a6a1f1dSLionel Sambuc const_reverse_iterator rbegin() const _NOEXCEPT { return v_.rbegin(); }
rend()58*0a6a1f1dSLionel Sambuc reverse_iterator rend() _NOEXCEPT { return v_.rend(); }
rend() const59*0a6a1f1dSLionel Sambuc const_reverse_iterator rend() const _NOEXCEPT { return v_.rend(); }
60*0a6a1f1dSLionel Sambuc
cbegin() const61*0a6a1f1dSLionel Sambuc const_iterator cbegin() const _NOEXCEPT { return v_.cbegin(); }
cend() const62*0a6a1f1dSLionel Sambuc const_iterator cend() const _NOEXCEPT { return v_.cend(); }
crbegin() const63*0a6a1f1dSLionel Sambuc const_reverse_iterator crbegin() const _NOEXCEPT { return v_.crbegin(); }
crend() const64*0a6a1f1dSLionel Sambuc const_reverse_iterator crend() const _NOEXCEPT { return v_.crend(); }
65*0a6a1f1dSLionel Sambuc
size() const66*0a6a1f1dSLionel Sambuc size_type size() const _NOEXCEPT { return v_.size(); }
max_size() const67*0a6a1f1dSLionel Sambuc size_type max_size() const _NOEXCEPT { return v_.max_size(); }
capacity() const68*0a6a1f1dSLionel Sambuc size_type capacity() const _NOEXCEPT { return v_.capacity(); }
empty() const69*0a6a1f1dSLionel Sambuc bool empty() const _NOEXCEPT { return v_.empty(); }
reserve(size_type n)70*0a6a1f1dSLionel Sambuc void reserve(size_type n) { v_.reserve(n); };
shrink_to_fit()71*0a6a1f1dSLionel Sambuc void shrink_to_fit() _NOEXCEPT { v_.shrink_to_fit(); }
72*0a6a1f1dSLionel Sambuc
operator [](size_type n)73*0a6a1f1dSLionel Sambuc reference operator[](size_type n) { return v_[n]; }
operator [](size_type n) const74*0a6a1f1dSLionel Sambuc const_reference operator[](size_type n) const { return v_[n]; }
at(size_type n)75*0a6a1f1dSLionel Sambuc reference at(size_type n) { return v_.at(n); }
at(size_type n) const76*0a6a1f1dSLionel Sambuc const_reference at(size_type n) const { return v_.at(n); }
77*0a6a1f1dSLionel Sambuc
front()78*0a6a1f1dSLionel Sambuc reference front() { return v_.front(); }
front() const79*0a6a1f1dSLionel Sambuc const_reference front() const { return v_.front(); }
back()80*0a6a1f1dSLionel Sambuc reference back() { return v_.back(); }
back() const81*0a6a1f1dSLionel Sambuc const_reference back() const { return v_.back(); }
82*0a6a1f1dSLionel Sambuc
data()83*0a6a1f1dSLionel Sambuc value_type* data() _NOEXCEPT { return v_.data(); }
data() const84*0a6a1f1dSLionel Sambuc const value_type* data() const _NOEXCEPT { return v_.data(); }
85*0a6a1f1dSLionel Sambuc
push_back(const value_type & x)86*0a6a1f1dSLionel Sambuc void push_back(const value_type& x) { v_.push_back(x); }
87*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
push_back(value_type && x)88*0a6a1f1dSLionel Sambuc void push_back(value_type&& x) { v_.push_back(std::forward<value_type&&>(x)); }
89*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_VARIADICS
90*0a6a1f1dSLionel Sambuc template <class... Args>
emplace_back(Args &&...args)91*0a6a1f1dSLionel Sambuc void emplace_back(Args&&... args) { v_.emplace_back(std::forward<Args>(args)...); }
92*0a6a1f1dSLionel Sambuc #endif
93*0a6a1f1dSLionel Sambuc #endif
pop_back()94*0a6a1f1dSLionel Sambuc void pop_back() { v_.pop_back(); }
95*0a6a1f1dSLionel Sambuc
96*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
97*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_VARIADICS
emplace(const_iterator pos,Args &&...args)98*0a6a1f1dSLionel Sambuc template <class... Args> iterator emplace(const_iterator pos, Args&&... args)
99*0a6a1f1dSLionel Sambuc { return v_.emplace(pos, std::forward<Args>(args)...); }
100*0a6a1f1dSLionel Sambuc #endif
101*0a6a1f1dSLionel Sambuc #endif
102*0a6a1f1dSLionel Sambuc
insert(const_iterator pos,const value_type & x)103*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, const value_type& x) { return v_.insert(pos, x); }
104*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
insert(const_iterator pos,value_type && x)105*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, value_type&& x) { return v_.insert(pos, std::forward<value_type>(x)); }
106*0a6a1f1dSLionel Sambuc #endif
insert(const_iterator pos,size_type n,const value_type & x)107*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, size_type n, const value_type& x) { return v_.insert(pos, n, x); }
108*0a6a1f1dSLionel Sambuc template <class InputIterator>
insert(const_iterator pos,InputIterator first,InputIterator last)109*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, InputIterator first, InputIterator last)
110*0a6a1f1dSLionel Sambuc { return v_.insert(pos, first, last); }
111*0a6a1f1dSLionel Sambuc
112*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
insert(const_iterator pos,std::initializer_list<value_type> il)113*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, std::initializer_list<value_type> il) { return v_.insert(pos, il); }
114*0a6a1f1dSLionel Sambuc #endif
115*0a6a1f1dSLionel Sambuc
erase(const_iterator pos)116*0a6a1f1dSLionel Sambuc iterator erase(const_iterator pos) { return v_.erase(pos); }
erase(const_iterator first,const_iterator last)117*0a6a1f1dSLionel Sambuc iterator erase(const_iterator first, const_iterator last) { return v_.erase(first, last); }
118*0a6a1f1dSLionel Sambuc
clear()119*0a6a1f1dSLionel Sambuc void clear() _NOEXCEPT { v_.clear(); }
120*0a6a1f1dSLionel Sambuc
resize(size_type sz)121*0a6a1f1dSLionel Sambuc void resize(size_type sz) { v_.resize(sz); }
resize(size_type sz,const value_type & c)122*0a6a1f1dSLionel Sambuc void resize(size_type sz, const value_type& c) { v_.resize(sz, c); }
123*0a6a1f1dSLionel Sambuc
swap(nasty_vector & nv)124*0a6a1f1dSLionel Sambuc void swap(nasty_vector &nv) _NOEXCEPT_(std::__is_nothrow_swappable<nested_container>::value)
125*0a6a1f1dSLionel Sambuc { v_.swap(nv.v_); }
126*0a6a1f1dSLionel Sambuc
operator &()127*0a6a1f1dSLionel Sambuc nasty_vector *operator &() { return nullptr; } // nasty
operator &() const128*0a6a1f1dSLionel Sambuc const nasty_vector *operator &() const { return nullptr; } // nasty
129*0a6a1f1dSLionel Sambuc
130*0a6a1f1dSLionel Sambuc nested_container v_;
131*0a6a1f1dSLionel Sambuc };
132*0a6a1f1dSLionel Sambuc
133*0a6a1f1dSLionel Sambuc template <class T>
operator ==(const nasty_vector<T> & x,const nasty_vector<T> & y)134*0a6a1f1dSLionel Sambuc bool operator==(const nasty_vector<T>& x, const nasty_vector<T>& y) { return x.v_ == y.v_; }
135*0a6a1f1dSLionel Sambuc
136*0a6a1f1dSLionel Sambuc template <class T>
137*0a6a1f1dSLionel Sambuc class nasty_list
138*0a6a1f1dSLionel Sambuc {
139*0a6a1f1dSLionel Sambuc public:
140*0a6a1f1dSLionel Sambuc
141*0a6a1f1dSLionel Sambuc typedef typename std::list<T> nested_container;
142*0a6a1f1dSLionel Sambuc typedef typename nested_container::value_type value_type;
143*0a6a1f1dSLionel Sambuc typedef typename nested_container::reference reference;
144*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_reference const_reference;
145*0a6a1f1dSLionel Sambuc typedef typename nested_container::iterator iterator;
146*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_iterator const_iterator;
147*0a6a1f1dSLionel Sambuc
148*0a6a1f1dSLionel Sambuc typedef typename nested_container::size_type size_type;
149*0a6a1f1dSLionel Sambuc typedef typename nested_container::difference_type difference_type;
150*0a6a1f1dSLionel Sambuc typedef typename nested_container::pointer pointer;
151*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_pointer const_pointer;
152*0a6a1f1dSLionel Sambuc
153*0a6a1f1dSLionel Sambuc typedef typename nested_container::reverse_iterator reverse_iterator;
154*0a6a1f1dSLionel Sambuc typedef typename nested_container::const_reverse_iterator const_reverse_iterator;
155*0a6a1f1dSLionel Sambuc
nasty_list()156*0a6a1f1dSLionel Sambuc nasty_list() : l_() {}
nasty_list(size_type n)157*0a6a1f1dSLionel Sambuc explicit nasty_list(size_type n) : l_(n) {}
nasty_list(size_type n,const value_type & value)158*0a6a1f1dSLionel Sambuc nasty_list(size_type n, const value_type& value) : l_(n,value) {}
159*0a6a1f1dSLionel Sambuc template <class Iter>
nasty_list(Iter first,Iter last)160*0a6a1f1dSLionel Sambuc nasty_list(Iter first, Iter last) : l_(first, last) {}
161*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
nasty_list(std::initializer_list<value_type> il)162*0a6a1f1dSLionel Sambuc nasty_list(std::initializer_list<value_type> il) : l_(il) {}
163*0a6a1f1dSLionel Sambuc #endif
164*0a6a1f1dSLionel Sambuc
~nasty_list()165*0a6a1f1dSLionel Sambuc ~nasty_list() {}
166*0a6a1f1dSLionel Sambuc
167*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
operator =(std::initializer_list<value_type> il)168*0a6a1f1dSLionel Sambuc nasty_list& operator=(std::initializer_list<value_type> il) { l_ = il; return *this; }
169*0a6a1f1dSLionel Sambuc #endif
170*0a6a1f1dSLionel Sambuc template <class Iter>
assign(Iter first,Iter last)171*0a6a1f1dSLionel Sambuc void assign(Iter first, Iter last) { l_.assign(first, last); }
assign(size_type n,const value_type & t)172*0a6a1f1dSLionel Sambuc void assign(size_type n, const value_type& t) { l_.assign(n, t); }
173*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
assign(std::initializer_list<value_type> il)174*0a6a1f1dSLionel Sambuc void assign(std::initializer_list<value_type> il) { l_.assign(il); }
175*0a6a1f1dSLionel Sambuc #endif
176*0a6a1f1dSLionel Sambuc
177*0a6a1f1dSLionel Sambuc
begin()178*0a6a1f1dSLionel Sambuc iterator begin() _NOEXCEPT { return l_.begin(); }
begin() const179*0a6a1f1dSLionel Sambuc const_iterator begin() const _NOEXCEPT { return l_.begin(); }
end()180*0a6a1f1dSLionel Sambuc iterator end() _NOEXCEPT { return l_.end(); }
end() const181*0a6a1f1dSLionel Sambuc const_iterator end() const _NOEXCEPT { return l_.end(); }
182*0a6a1f1dSLionel Sambuc
rbegin()183*0a6a1f1dSLionel Sambuc reverse_iterator rbegin() _NOEXCEPT { return l_.rbegin(); }
rbegin() const184*0a6a1f1dSLionel Sambuc const_reverse_iterator rbegin() const _NOEXCEPT { return l_.rbegin(); }
rend()185*0a6a1f1dSLionel Sambuc reverse_iterator rend() _NOEXCEPT { return l_.rend(); }
rend() const186*0a6a1f1dSLionel Sambuc const_reverse_iterator rend() const _NOEXCEPT { return l_.rend(); }
187*0a6a1f1dSLionel Sambuc
cbegin() const188*0a6a1f1dSLionel Sambuc const_iterator cbegin() const _NOEXCEPT { return l_.cbegin(); }
cend() const189*0a6a1f1dSLionel Sambuc const_iterator cend() const _NOEXCEPT { return l_.cend(); }
crbegin() const190*0a6a1f1dSLionel Sambuc const_reverse_iterator crbegin() const _NOEXCEPT { return l_.crbegin(); }
crend() const191*0a6a1f1dSLionel Sambuc const_reverse_iterator crend() const _NOEXCEPT { return l_.crend(); }
192*0a6a1f1dSLionel Sambuc
front()193*0a6a1f1dSLionel Sambuc reference front() { return l_.front(); }
front() const194*0a6a1f1dSLionel Sambuc const_reference front() const { return l_.front(); }
back()195*0a6a1f1dSLionel Sambuc reference back() { return l_.back(); }
back() const196*0a6a1f1dSLionel Sambuc const_reference back() const { return l_.back(); }
197*0a6a1f1dSLionel Sambuc
size() const198*0a6a1f1dSLionel Sambuc size_type size() const _NOEXCEPT { return l_.size(); }
max_size() const199*0a6a1f1dSLionel Sambuc size_type max_size() const _NOEXCEPT { return l_.max_size(); }
empty() const200*0a6a1f1dSLionel Sambuc bool empty() const _NOEXCEPT { return l_.empty(); }
201*0a6a1f1dSLionel Sambuc
push_front(const value_type & x)202*0a6a1f1dSLionel Sambuc void push_front(const value_type& x) { l_.push_front(x); }
push_back(const value_type & x)203*0a6a1f1dSLionel Sambuc void push_back(const value_type& x) { l_.push_back(x); }
204*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
push_back(value_type && x)205*0a6a1f1dSLionel Sambuc void push_back(value_type&& x) { l_.push_back(std::forward<value_type&&>(x)); }
push_front(value_type && x)206*0a6a1f1dSLionel Sambuc void push_front(value_type&& x) { l_.push_back(std::forward<value_type&&>(x)); }
207*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_VARIADICS
208*0a6a1f1dSLionel Sambuc template <class... Args>
emplace_back(Args &&...args)209*0a6a1f1dSLionel Sambuc void emplace_back(Args&&... args) { l_.emplace_back(std::forward<Args>(args)...); }
210*0a6a1f1dSLionel Sambuc template <class... Args>
emplace_front(Args &&...args)211*0a6a1f1dSLionel Sambuc void emplace_front(Args&&... args) { l_.emplace_front(std::forward<Args>(args)...); }
212*0a6a1f1dSLionel Sambuc #endif
213*0a6a1f1dSLionel Sambuc #endif
pop_front()214*0a6a1f1dSLionel Sambuc void pop_front() { l_.pop_front(); }
pop_back()215*0a6a1f1dSLionel Sambuc void pop_back() { l_.pop_back(); }
216*0a6a1f1dSLionel Sambuc
217*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
218*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_VARIADICS
emplace(const_iterator pos,Args &&...args)219*0a6a1f1dSLionel Sambuc template <class... Args> iterator emplace(const_iterator pos, Args&&... args)
220*0a6a1f1dSLionel Sambuc { return l_.emplace(pos, std::forward<Args>(args)...); }
221*0a6a1f1dSLionel Sambuc #endif
222*0a6a1f1dSLionel Sambuc #endif
223*0a6a1f1dSLionel Sambuc
insert(const_iterator pos,const value_type & x)224*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, const value_type& x) { return l_.insert(pos, x); }
225*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
insert(const_iterator pos,value_type && x)226*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, value_type&& x) { return l_.insert(pos, std::forward<value_type>(x)); }
227*0a6a1f1dSLionel Sambuc #endif
insert(const_iterator pos,size_type n,const value_type & x)228*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, size_type n, const value_type& x) { return l_.insert(pos, n, x); }
229*0a6a1f1dSLionel Sambuc template <class InputIterator>
insert(const_iterator pos,InputIterator first,InputIterator last)230*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, InputIterator first, InputIterator last)
231*0a6a1f1dSLionel Sambuc { return l_.insert(pos, first, last); }
232*0a6a1f1dSLionel Sambuc
233*0a6a1f1dSLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
insert(const_iterator pos,std::initializer_list<value_type> il)234*0a6a1f1dSLionel Sambuc iterator insert(const_iterator pos, std::initializer_list<value_type> il) { return l_.insert(pos, il); }
235*0a6a1f1dSLionel Sambuc #endif
236*0a6a1f1dSLionel Sambuc
erase(const_iterator pos)237*0a6a1f1dSLionel Sambuc iterator erase(const_iterator pos) { return l_.erase(pos); }
erase(const_iterator pos,const_iterator last)238*0a6a1f1dSLionel Sambuc iterator erase(const_iterator pos, const_iterator last) { return l_.erase(pos, last); }
239*0a6a1f1dSLionel Sambuc
resize(size_type sz)240*0a6a1f1dSLionel Sambuc void resize(size_type sz) { l_.resize(); }
resize(size_type sz,const value_type & c)241*0a6a1f1dSLionel Sambuc void resize(size_type sz, const value_type& c) { l_.resize(c); }
242*0a6a1f1dSLionel Sambuc
swap(nasty_list & nl)243*0a6a1f1dSLionel Sambuc void swap(nasty_list &nl) _NOEXCEPT_(std::__is_nothrow_swappable<nested_container>::value)
244*0a6a1f1dSLionel Sambuc { l_.swap(nl.l_); }
245*0a6a1f1dSLionel Sambuc
clear()246*0a6a1f1dSLionel Sambuc void clear() _NOEXCEPT { l_.clear(); }
247*0a6a1f1dSLionel Sambuc
248*0a6a1f1dSLionel Sambuc // void splice(const_iterator position, list& x);
249*0a6a1f1dSLionel Sambuc // void splice(const_iterator position, list&& x);
250*0a6a1f1dSLionel Sambuc // void splice(const_iterator position, list& x, const_iterator i);
251*0a6a1f1dSLionel Sambuc // void splice(const_iterator position, list&& x, const_iterator i);
252*0a6a1f1dSLionel Sambuc // void splice(const_iterator position, list& x, const_iterator first,
253*0a6a1f1dSLionel Sambuc // const_iterator last);
254*0a6a1f1dSLionel Sambuc // void splice(const_iterator position, list&& x, const_iterator first,
255*0a6a1f1dSLionel Sambuc // const_iterator last);
256*0a6a1f1dSLionel Sambuc //
257*0a6a1f1dSLionel Sambuc // void remove(const value_type& value);
258*0a6a1f1dSLionel Sambuc // template <class Pred> void remove_if(Pred pred);
259*0a6a1f1dSLionel Sambuc // void unique();
260*0a6a1f1dSLionel Sambuc // template <class BinaryPredicate>
261*0a6a1f1dSLionel Sambuc // void unique(BinaryPredicate binary_pred);
262*0a6a1f1dSLionel Sambuc // void merge(list& x);
263*0a6a1f1dSLionel Sambuc // void merge(list&& x);
264*0a6a1f1dSLionel Sambuc // template <class Compare>
265*0a6a1f1dSLionel Sambuc // void merge(list& x, Compare comp);
266*0a6a1f1dSLionel Sambuc // template <class Compare>
267*0a6a1f1dSLionel Sambuc // void merge(list&& x, Compare comp);
268*0a6a1f1dSLionel Sambuc // void sort();
269*0a6a1f1dSLionel Sambuc // template <class Compare>
270*0a6a1f1dSLionel Sambuc // void sort(Compare comp);
271*0a6a1f1dSLionel Sambuc // void reverse() noexcept;
272*0a6a1f1dSLionel Sambuc
operator &()273*0a6a1f1dSLionel Sambuc nasty_list *operator &() { return nullptr; } // nasty
operator &() const274*0a6a1f1dSLionel Sambuc const nasty_list *operator &() const { return nullptr; } // nasty
275*0a6a1f1dSLionel Sambuc
276*0a6a1f1dSLionel Sambuc nested_container l_;
277*0a6a1f1dSLionel Sambuc };
278*0a6a1f1dSLionel Sambuc
279*0a6a1f1dSLionel Sambuc template <class T>
operator ==(const nasty_list<T> & x,const nasty_list<T> & y)280*0a6a1f1dSLionel Sambuc bool operator==(const nasty_list<T>& x, const nasty_list<T>& y) { return x.l_ == y.l_; }
281*0a6a1f1dSLionel Sambuc
282*0a6a1f1dSLionel Sambuc #endif
283