9 #include <odb/details/config.hxx>
17 # ifdef ODB_CXX11_INITIALIZER_LIST
18 # include <initializer_list>
31 # define LIBODB_VECTOR_ARG_DEFAULT ,int = 0
32 # define LIBODB_VECTOR_ARG_DECL ,int DUMMY
33 # define LIBODB_VECTOR_ARG_USE ,DUMMY
35 # define LIBODB_VECTOR_ARG_DEFAULT
36 # define LIBODB_VECTOR_ARG_DECL
37 # define LIBODB_VECTOR_ARG_USE
47 template <
class V,
class I>
50 template <
class T,
class A = std::allocator<T> LIBODB_VECTOR_ARG_DEFAULT>
56 typedef typename base_vector_type::reverse_iterator
60 typedef typename base_vector_type::reference
reference;
64 typedef typename base_vector_type::size_type
size_type;
68 typedef typename base_vector_type::pointer
pointer;
72 #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
76 typedef typename base_vector_type::const_reverse_iterator
80 explicit vector(
const A& a = A()): v_ (a) {}
84 vector(I f, I l,
const A& a = A()) : v_ (f, l, a) {}
92 {
return v_.get_allocator ();}
98 :
vector_base (std::move (x)), v_ (std::move (x.v_), a) {}
100 #ifdef ODB_CXX11_INITIALIZER_LIST
101 vector(std::initializer_list<T> il,
const A& a = A()): v_ (il, a) {}
103 void assign(std::initializer_list<T>);
113 #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
142 bool empty() const {
return v_.empty ();}
146 void shrink_to_fit();
169 const T* data() const {
return v_.data ();}
193 #ifdef ODB_CXX11_VARIADIC_TEMPLATE
194 template <
class... Args>
195 void emplace_back(Args&&... args);
196 template <
class... Args>
229 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
234 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
236 const std::vector<T,A>& y)
237 {
return x.
base () == y;}
239 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
242 {
return x == y.
base ();}
244 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
245 inline bool operator< (const vector<T,A LIBODB_VECTOR_ARG_USE>& x,
247 {
return x.
base () < y.base ();}
249 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
250 inline bool operator<(const vector<T,A LIBODB_VECTOR_ARG_USE>& x,
251 const std::vector<T,A>& y)
252 {
return x.base () < y;}
254 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
255 inline bool operator<(const std::vector<T,A>& x,
257 {
return x < y.
base ();}
259 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
264 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
266 const std::vector<T,A>& y)
267 {
return x.
base () != y;}
269 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
272 {
return x != y.
base ();}
274 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
279 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
284 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
286 const std::vector<T,A>& y)
287 {
return x.
base () >= y;}
289 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
292 {
return x >= y.
base ();}
294 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
295 inline bool operator<=(const vector<T,A LIBODB_VECTOR_ARG_USE>& x,
297 {
return x.
base () <= y.base ();}
299 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
300 inline bool operator<=(const vector<T,A LIBODB_VECTOR_ARG_USE>& x,
301 const std::vector<T,A>& y)
302 {
return x.base () <= y;}
304 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
305 inline bool operator<=(const std::vector<T,A>& x,
307 {
return x <= y.
base ();}
309 template <
class V,
class I>
310 class vector_iterator
319 #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
322 typedef typename base_iterator_traits::value_type
value_type;
324 typedef typename base_iterator_traits::pointer
pointer;
325 typedef typename base_iterator_traits::reference
reference;
330 typedef typename vector_type::value_type
value_type;
331 typedef typename vector_type::pointer
pointer;
332 typedef typename vector_type::reference
reference;
360 if (v_->_tracking ())
361 v_->_impl ().modify (
362 static_cast<size_type> (i_ - v_->base ().begin ()));
368 if (v_->_tracking ())
369 v_->_impl ().modify (
370 static_cast<size_type> (i_ - v_->base ().begin () + n));
396 #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
397 template <
class V,
class J>
407 typedef typename base_iterator_traits::value_type
value_type;
409 typedef typename base_iterator_traits::pointer
pointer;
410 typedef typename base_iterator_traits::reference
reference;
437 if (v_->_tracking ())
438 v_->_impl ().modify (
439 static_cast<size_type> (v_->base ().rend () - i_ - 1));
445 if (v_->_tracking ())
447 v_->_impl ().modify (
448 static_cast<size_type> (v_->base ().rend () - i_ - 1 - n));
473 #endif // _RWSTD_NO_CLASS_PARTIAL_SPEC
477 template <
class V,
class I>
480 {
return x._base () == y._base ();}
482 template <
class V,
class I>
486 {
return x._base () == y;}
488 template <
class V,
class I>
492 {
return x == y._base ();}
496 template <
class V,
class I>
499 {
return x.
_base () < y._base ();}
501 template <
class V,
class I>
503 operator< (const vector_iterator<V, I>& x,
505 {
return x._base () < y;}
507 template <
class V,
class I>
509 operator< (const typename vector_iterator<V, I>::const_iterator_type& x,
511 {
return x < y.
_base ();}
515 template <
class V,
class I>
518 {
return x._base () != y._base ();}
520 template <
class V,
class I>
524 {
return x._base () != y;}
526 template <
class V,
class I>
530 {
return x != y._base ();}
534 template <
class V,
class I>
537 {
return x._base () > y._base ();}
539 template <
class V,
class I>
543 {
return x._base () > y;}
545 template <
class V,
class I>
549 {
return x > y._base ();}
553 template <
class V,
class I>
556 {
return x._base () >= y._base ();}
558 template <
class V,
class I>
562 {
return x._base () >= y;}
564 template <
class V,
class I>
568 {
return x >= y._base ();}
572 template <
class V,
class I>
575 {
return x.
_base () <= y._base ();}
577 template <
class V,
class I>
579 operator<= (const vector_iterator<V, I>& x,
581 {
return x._base () <= y;}
583 template <
class V,
class I>
585 operator<= (const typename vector_iterator<V, I>::const_iterator_type& x,
587 {
return x <= y.
_base ();}
591 template <
class V,
class I>
592 inline typename vector_iterator<V, I>::difference_type
594 {
return x._base () - y._base ();}
596 template <
class V,
class I>
597 inline typename vector_iterator<V, I>::difference_type
600 {
return x._base () - y;}
602 template <
class V,
class I>
603 inline typename vector_iterator<V, I>::difference_type
606 {
return x - y._base ();}
610 template <
class V,
class I>
611 inline vector_iterator<V, I>
619 template <
class T,
class A LIBODB_VECTOR_ARG_DECL>
624 #include <odb/vector.ixx>
630 #endif // ODB_VECTOR_HXX
vector_iterator()
Definition: vector.hxx:417
vector_type::const_reverse_iterator const_iterator_type
Definition: vector.hxx:403
base_vector_type::const_iterator const_iterator
Definition: vector.hxx:63
vector_iterator< V, I >::difference_type operator-(const vector_iterator< V, I > &x, const vector_iterator< V, I > &y)
Definition: vector.hxx:593
base_reverse_iterator_type mrbegin()
vector_iterator()
Definition: vector.hxx:341
const_reference front() const
Definition: vector.hxx:159
std::vector< T, A > base_vector_type
Definition: vector.hxx:54
bool operator>=(const schema_version_migration &x, const schema_version_migration &y)
Definition: schema-version.hxx:64
const_reverse_iterator rbegin() const
Definition: vector.hxx:117
base_iterator_type _base() const
Definition: vector.hxx:467
iterator end()
Definition: vector.hxx:110
V vector_type
Definition: vector.hxx:313
const_reference operator[](size_type n) const
Definition: vector.hxx:153
void _start() const
Definition: vector.hxx:218
vector_iterator operator-(difference_type n) const
Definition: vector.hxx:382
const_reference operator[](difference_type n) const
Definition: vector.hxx:352
vector_iterator(vector_type *v, const base_iterator_type &i)
Definition: vector.hxx:420
reference modify_at(size_type n)
vector & operator=(const vector &)
base_iterator_traits::iterator_category iterator_category
Definition: vector.hxx:326
base_iterator_type base() const
Definition: vector.hxx:345
base_iterator_traits::reference reference
Definition: vector.hxx:325
Definition: vector.hxx:48
base_vector_type & base()
Definition: vector.hxx:206
vector_type::const_iterator const_iterator_type
Definition: vector.hxx:315
reverse_iterator rend()
Definition: vector.hxx:115
base_iterator_traits::iterator_category iterator_category
Definition: vector.hxx:411
iterator insert(iterator position, const T &x)
std::reverse_iterator< J > base_iterator_type
Definition: vector.hxx:402
const_reverse_iterator rend() const
Definition: vector.hxx:118
base_vector_type::size_type size_type
Definition: vector.hxx:64
base_iterator_type _base() const
Definition: vector.hxx:389
vector(const base_vector_type &x)
Definition: vector.hxx:203
vector_type::const_pointer const_pointer
Definition: vector.hxx:415
base_vector_type::const_pointer const_pointer
Definition: vector.hxx:69
void push_back(const T &x)
vector_type::size_type size_type
Definition: vector.hxx:413
iterator_type base() const
Definition: vector.hxx:423
base_iterator_traits::pointer pointer
Definition: vector.hxx:324
vector_iterator(const iterator_type &i)
Definition: vector.hxx:418
std::iterator_traits< base_iterator_type > base_iterator_traits
Definition: vector.hxx:404
vector_iterator & operator-=(difference_type n)
Definition: vector.hxx:384
reference modify() const
Definition: vector.hxx:358
reference modify(difference_type n) const
Definition: vector.hxx:366
vector_type::iterator iterator_type
Definition: vector.hxx:406
base_iterator_traits::value_type value_type
Definition: vector.hxx:407
base_iterator_traits::difference_type difference_type
Definition: vector.hxx:323
base_vector_type::reference reference
Definition: vector.hxx:60
base_vector_type::iterator base_iterator_type
Definition: vector.hxx:55
reference modify() const
Definition: vector.hxx:435
const_reference at(size_type n) const
Definition: vector.hxx:156
const_pointer operator->() const
Definition: vector.hxx:351
vector_iterator< vector, base_reverse_iterator_type > reverse_iterator
Definition: vector.hxx:74
size_type size() const
Definition: vector.hxx:137
const base_vector_type & base() const
Definition: vector.hxx:207
base_vector_type::const_reverse_iterator const_reverse_iterator
Definition: vector.hxx:77
vector(size_type n, const T &v, const A &a=A())
Definition: vector.hxx:82
bool empty() const
Definition: vector.hxx:142
T value_type
Definition: vector.hxx:66
vector_impl impl_
Definition: vector-impl.hxx:213
base_vector_type::reverse_iterator base_reverse_iterator_type
Definition: vector.hxx:57
vector_type::const_pointer const_pointer
Definition: vector.hxx:339
bool operator!=(const lazy_ptr< T > &, const lazy_ptr< Y > &)
vector_iterator & operator+=(difference_type n)
Definition: vector.hxx:381
reference modify(difference_type n) const
Definition: vector.hxx:443
vector_iterator< vector, base_iterator_type > iterator
Definition: vector.hxx:62
vector_type * vector() const
Definition: vector.hxx:425
vector_type::const_reference const_reference
Definition: vector.hxx:338
reverse_iterator rbegin()
Definition: vector.hxx:114
Definition: vector-impl.hxx:173
V vector_type
Definition: vector.hxx:401
iterator erase(iterator position)
vector_type::size_type size_type
Definition: vector.hxx:337
vector_iterator(vector_type *v, const base_iterator_type &i)
Definition: vector.hxx:342
vector(const A &a=A())
Definition: vector.hxx:80
base_iterator_type rbase() const
Definition: vector.hxx:424
void swap(lazy_ptr< T > &, lazy_ptr< T > &)
base_iterator_traits::difference_type difference_type
Definition: vector.hxx:408
const_iterator end() const
Definition: vector.hxx:112
query_base operator+(const query_base &x, const query_base &y)
Definition: query-dynamic.hxx:325
vector_type * vector() const
Definition: vector.hxx:346
const_iterator begin() const
Definition: vector.hxx:111
base_iterator_traits::reference reference
Definition: vector.hxx:410
size_type max_size() const
Definition: vector.hxx:138
allocator_type get_allocator() const
Definition: vector.hxx:91
vector_iterator & operator++()
Definition: vector.hxx:374
iterator begin()
Definition: vector.hxx:109
vector_type::const_reference const_reference
Definition: vector.hxx:414
base_reverse_iterator_type mrend()
Definition: vector.hxx:126
base_iterator_traits::pointer pointer
Definition: vector.hxx:409
vector_base()
Definition: vector-impl.hxx:194
I base_iterator_type
Definition: vector.hxx:314
bool operator==(const lazy_ptr< T > &, const lazy_ptr< Y > &)
base_iterator_traits::value_type value_type
Definition: vector.hxx:322
vector(I f, I l, const A &a=A())
Definition: vector.hxx:84
reference modify(size_type n)
size_type capacity() const
Definition: vector.hxx:141
const_reference operator*() const
Definition: vector.hxx:350
base_iterator_type mend()
Definition: vector.hxx:124
base_vector_type::pointer pointer
Definition: vector.hxx:68
base_iterator_type mbegin()
std::iterator_traits< base_iterator_type > base_iterator_traits
Definition: vector.hxx:320
Definition: vector.hxx:51
A allocator_type
Definition: vector.hxx:67
vector_iterator & operator--()
Definition: vector.hxx:376
const_reference back() const
Definition: vector.hxx:162
vector(size_type n)
Definition: vector.hxx:81
vector(const vector &x)
Definition: vector.hxx:85
vector_iterator operator+(difference_type n) const
Definition: vector.hxx:379
base_vector_type::const_reference const_reference
Definition: vector.hxx:61
bool operator>(const schema_version_migration &x, const schema_version_migration &y)
Definition: schema-version.hxx:49
base_vector_type::difference_type difference_type
Definition: vector.hxx:65