Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/container/detail/iterators.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
1 ////////////////////////////////////////////////////////////////////////////// | 1 ////////////////////////////////////////////////////////////////////////////// |
2 // | 2 // |
3 // (C) Copyright Ion Gaztanaga 2005-2012. | 3 // (C) Copyright Ion Gaztanaga 2005-2013. |
4 // (C) Copyright Gennaro Prota 2003 - 2004. | 4 // (C) Copyright Gennaro Prota 2003 - 2004. |
5 // | 5 // |
6 // Distributed under the Boost Software License, Version 1.0. | 6 // Distributed under the Boost Software License, Version 1.0. |
7 // (See accompanying file LICENSE_1_0.txt or copy at | 7 // (See accompanying file LICENSE_1_0.txt or copy at |
8 // http://www.boost.org/LICENSE_1_0.txt) | 8 // http://www.boost.org/LICENSE_1_0.txt) |
12 ////////////////////////////////////////////////////////////////////////////// | 12 ////////////////////////////////////////////////////////////////////////////// |
13 | 13 |
14 #ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP | 14 #ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP |
15 #define BOOST_CONTAINER_DETAIL_ITERATORS_HPP | 15 #define BOOST_CONTAINER_DETAIL_ITERATORS_HPP |
16 | 16 |
17 #if defined(_MSC_VER) | 17 #ifndef BOOST_CONFIG_HPP |
18 # include <boost/config.hpp> | |
19 #endif | |
20 | |
21 #if defined(BOOST_HAS_PRAGMA_ONCE) | |
18 # pragma once | 22 # pragma once |
19 #endif | 23 #endif |
20 | 24 |
21 #include "config_begin.hpp" | 25 #include <boost/container/detail/config_begin.hpp> |
22 #include <boost/container/detail/workaround.hpp> | 26 #include <boost/container/detail/workaround.hpp> |
23 #include <boost/move/utility.hpp> | |
24 #include <boost/container/allocator_traits.hpp> | 27 #include <boost/container/allocator_traits.hpp> |
25 #include <boost/container/detail/type_traits.hpp> | 28 #include <boost/container/detail/type_traits.hpp> |
26 #include <boost/static_assert.hpp> | 29 #include <boost/static_assert.hpp> |
27 | 30 #include <boost/move/utility_core.hpp> |
28 #ifdef BOOST_CONTAINER_PERFECT_FORWARDING | 31 #include <boost/intrusive/detail/reverse_iterator.hpp> |
32 | |
33 #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) | |
34 #include <boost/move/detail/fwd_macros.hpp> | |
35 #else | |
29 #include <boost/container/detail/variadic_templates_tools.hpp> | 36 #include <boost/container/detail/variadic_templates_tools.hpp> |
30 #else | |
31 #include <boost/container/detail/preprocessor.hpp> | |
32 #endif | 37 #endif |
33 | 38 #include <boost/container/detail/iterator.hpp> |
34 #include <iterator> | |
35 | 39 |
36 namespace boost { | 40 namespace boost { |
37 namespace container { | 41 namespace container { |
38 | 42 |
39 template <class T, class Difference = std::ptrdiff_t> | 43 template <class T, class Difference = std::ptrdiff_t> |
40 class constant_iterator | 44 class constant_iterator |
41 : public std::iterator | 45 : public ::boost::container::iterator |
42 <std::random_access_iterator_tag, T, Difference, const T*, const T &> | 46 <std::random_access_iterator_tag, T, Difference, const T*, const T &> |
43 { | 47 { |
44 typedef constant_iterator<T, Difference> this_type; | 48 typedef constant_iterator<T, Difference> this_type; |
45 | 49 |
46 public: | 50 public: |
51 constant_iterator() | 55 constant_iterator() |
52 : m_ptr(0), m_num(0){} | 56 : m_ptr(0), m_num(0){} |
53 | 57 |
54 constant_iterator& operator++() | 58 constant_iterator& operator++() |
55 { increment(); return *this; } | 59 { increment(); return *this; } |
56 | 60 |
57 constant_iterator operator++(int) | 61 constant_iterator operator++(int) |
58 { | 62 { |
59 constant_iterator result (*this); | 63 constant_iterator result (*this); |
60 increment(); | 64 increment(); |
61 return result; | 65 return result; |
62 } | 66 } |
63 | 67 |
64 constant_iterator& operator--() | 68 constant_iterator& operator--() |
65 { decrement(); return *this; } | 69 { decrement(); return *this; } |
66 | 70 |
67 constant_iterator operator--(int) | 71 constant_iterator operator--(int) |
68 { | 72 { |
69 constant_iterator result (*this); | 73 constant_iterator result (*this); |
70 decrement(); | 74 decrement(); |
71 return result; | 75 return result; |
145 | 149 |
146 Difference distance_to(const this_type &other)const | 150 Difference distance_to(const this_type &other)const |
147 { return m_num - other.m_num; } | 151 { return m_num - other.m_num; } |
148 }; | 152 }; |
149 | 153 |
150 template <class T, class Difference = std::ptrdiff_t> | 154 template <class T, class Difference> |
151 class value_init_construct_iterator | 155 class value_init_construct_iterator |
152 : public std::iterator | 156 : public ::boost::container::iterator |
153 <std::random_access_iterator_tag, T, Difference, const T*, const T &> | 157 <std::random_access_iterator_tag, T, Difference, const T*, const T &> |
154 { | 158 { |
155 typedef value_init_construct_iterator<T, Difference> this_type; | 159 typedef value_init_construct_iterator<T, Difference> this_type; |
156 | 160 |
157 public: | 161 public: |
162 value_init_construct_iterator() | 166 value_init_construct_iterator() |
163 : m_num(0){} | 167 : m_num(0){} |
164 | 168 |
165 value_init_construct_iterator& operator++() | 169 value_init_construct_iterator& operator++() |
166 { increment(); return *this; } | 170 { increment(); return *this; } |
167 | 171 |
168 value_init_construct_iterator operator++(int) | 172 value_init_construct_iterator operator++(int) |
169 { | 173 { |
170 value_init_construct_iterator result (*this); | 174 value_init_construct_iterator result (*this); |
171 increment(); | 175 increment(); |
172 return result; | 176 return result; |
173 } | 177 } |
174 | 178 |
175 value_init_construct_iterator& operator--() | 179 value_init_construct_iterator& operator--() |
176 { decrement(); return *this; } | 180 { decrement(); return *this; } |
177 | 181 |
178 value_init_construct_iterator operator--(int) | 182 value_init_construct_iterator operator--(int) |
179 { | 183 { |
180 value_init_construct_iterator result (*this); | 184 value_init_construct_iterator result (*this); |
181 decrement(); | 185 decrement(); |
182 return result; | 186 return result; |
256 | 260 |
257 Difference distance_to(const this_type &other)const | 261 Difference distance_to(const this_type &other)const |
258 { return m_num - other.m_num; } | 262 { return m_num - other.m_num; } |
259 }; | 263 }; |
260 | 264 |
261 template <class T, class Difference = std::ptrdiff_t> | 265 template <class T, class Difference> |
262 class default_init_construct_iterator | 266 class default_init_construct_iterator |
263 : public std::iterator | 267 : public ::boost::container::iterator |
264 <std::random_access_iterator_tag, T, Difference, const T*, const T &> | 268 <std::random_access_iterator_tag, T, Difference, const T*, const T &> |
265 { | 269 { |
266 typedef default_init_construct_iterator<T, Difference> this_type; | 270 typedef default_init_construct_iterator<T, Difference> this_type; |
267 | 271 |
268 public: | 272 public: |
273 default_init_construct_iterator() | 277 default_init_construct_iterator() |
274 : m_num(0){} | 278 : m_num(0){} |
275 | 279 |
276 default_init_construct_iterator& operator++() | 280 default_init_construct_iterator& operator++() |
277 { increment(); return *this; } | 281 { increment(); return *this; } |
278 | 282 |
279 default_init_construct_iterator operator++(int) | 283 default_init_construct_iterator operator++(int) |
280 { | 284 { |
281 default_init_construct_iterator result (*this); | 285 default_init_construct_iterator result (*this); |
282 increment(); | 286 increment(); |
283 return result; | 287 return result; |
284 } | 288 } |
285 | 289 |
286 default_init_construct_iterator& operator--() | 290 default_init_construct_iterator& operator--() |
287 { decrement(); return *this; } | 291 { decrement(); return *this; } |
288 | 292 |
289 default_init_construct_iterator operator--(int) | 293 default_init_construct_iterator operator--(int) |
290 { | 294 { |
291 default_init_construct_iterator result (*this); | 295 default_init_construct_iterator result (*this); |
292 decrement(); | 296 decrement(); |
293 return result; | 297 return result; |
370 }; | 374 }; |
371 | 375 |
372 | 376 |
373 template <class T, class Difference = std::ptrdiff_t> | 377 template <class T, class Difference = std::ptrdiff_t> |
374 class repeat_iterator | 378 class repeat_iterator |
375 : public std::iterator | 379 : public ::boost::container::iterator |
376 <std::random_access_iterator_tag, T, Difference> | 380 <std::random_access_iterator_tag, T, Difference> |
377 { | 381 { |
378 typedef repeat_iterator<T, Difference> this_type; | 382 typedef repeat_iterator<T, Difference> this_type; |
379 public: | 383 public: |
380 explicit repeat_iterator(T &ref, Difference range_size) | 384 explicit repeat_iterator(T &ref, Difference range_size) |
384 repeat_iterator() | 388 repeat_iterator() |
385 : m_ptr(0), m_num(0){} | 389 : m_ptr(0), m_num(0){} |
386 | 390 |
387 this_type& operator++() | 391 this_type& operator++() |
388 { increment(); return *this; } | 392 { increment(); return *this; } |
389 | 393 |
390 this_type operator++(int) | 394 this_type operator++(int) |
391 { | 395 { |
392 this_type result (*this); | 396 this_type result (*this); |
393 increment(); | 397 increment(); |
394 return result; | 398 return result; |
395 } | 399 } |
396 | 400 |
397 this_type& operator--() | 401 this_type& operator--() |
398 { increment(); return *this; } | 402 { increment(); return *this; } |
399 | 403 |
400 this_type operator--(int) | 404 this_type operator--(int) |
401 { | 405 { |
402 this_type result (*this); | 406 this_type result (*this); |
403 increment(); | 407 increment(); |
404 return result; | 408 return result; |
480 { return m_num - other.m_num; } | 484 { return m_num - other.m_num; } |
481 }; | 485 }; |
482 | 486 |
483 template <class T, class EmplaceFunctor, class Difference /*= std::ptrdiff_t*/> | 487 template <class T, class EmplaceFunctor, class Difference /*= std::ptrdiff_t*/> |
484 class emplace_iterator | 488 class emplace_iterator |
485 : public std::iterator | 489 : public ::boost::container::iterator |
486 <std::random_access_iterator_tag, T, Difference, const T*, const T &> | 490 <std::random_access_iterator_tag, T, Difference, const T*, const T &> |
487 { | 491 { |
488 typedef emplace_iterator this_type; | 492 typedef emplace_iterator this_type; |
489 | 493 |
490 public: | 494 public: |
495 emplace_iterator() | 499 emplace_iterator() |
496 : m_num(0), m_pe(0){} | 500 : m_num(0), m_pe(0){} |
497 | 501 |
498 this_type& operator++() | 502 this_type& operator++() |
499 { increment(); return *this; } | 503 { increment(); return *this; } |
500 | 504 |
501 this_type operator++(int) | 505 this_type operator++(int) |
502 { | 506 { |
503 this_type result (*this); | 507 this_type result (*this); |
504 increment(); | 508 increment(); |
505 return result; | 509 return result; |
506 } | 510 } |
507 | 511 |
508 this_type& operator--() | 512 this_type& operator--() |
509 { decrement(); return *this; } | 513 { decrement(); return *this; } |
510 | 514 |
511 this_type operator--(int) | 515 this_type operator--(int) |
512 { | 516 { |
513 this_type result (*this); | 517 this_type result (*this); |
514 decrement(); | 518 decrement(); |
515 return result; | 519 return result; |
561 //So comment them to catch bad uses | 565 //So comment them to catch bad uses |
562 //const T& operator*() const; | 566 //const T& operator*() const; |
563 //const T& operator[](difference_type) const; | 567 //const T& operator[](difference_type) const; |
564 //const T* operator->() const; | 568 //const T* operator->() const; |
565 | 569 |
566 template<class A> | 570 template<class Allocator> |
567 void construct_in_place(A &a, T* ptr) | 571 void construct_in_place(Allocator &a, T* ptr) |
568 { (*m_pe)(a, ptr); } | 572 { (*m_pe)(a, ptr); } |
569 | 573 |
570 private: | 574 private: |
571 difference_type m_num; | 575 difference_type m_num; |
572 EmplaceFunctor * m_pe; | 576 EmplaceFunctor * m_pe; |
594 | 598 |
595 difference_type distance_to(const this_type &other)const | 599 difference_type distance_to(const this_type &other)const |
596 { return difference_type(m_num - other.m_num); } | 600 { return difference_type(m_num - other.m_num); } |
597 }; | 601 }; |
598 | 602 |
599 #ifdef BOOST_CONTAINER_PERFECT_FORWARDING | 603 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) |
600 | 604 |
601 template<class ...Args> | 605 template<class ...Args> |
602 struct emplace_functor | 606 struct emplace_functor |
603 { | 607 { |
604 typedef typename container_detail::build_number_seq<sizeof...(Args)>::type index_tuple_t; | 608 typedef typename container_detail::build_number_seq<sizeof...(Args)>::type index_tuple_t; |
605 | 609 |
606 emplace_functor(Args&&... args) | 610 emplace_functor(BOOST_FWD_REF(Args)... args) |
607 : args_(args...) | 611 : args_(args...) |
608 {} | 612 {} |
609 | 613 |
610 template<class A, class T> | 614 template<class Allocator, class T> |
611 void operator()(A &a, T *ptr) | 615 void operator()(Allocator &a, T *ptr) |
612 { emplace_functor::inplace_impl(a, ptr, index_tuple_t()); } | 616 { emplace_functor::inplace_impl(a, ptr, index_tuple_t()); } |
613 | 617 |
614 template<class A, class T, int ...IdxPack> | 618 template<class Allocator, class T, int ...IdxPack> |
615 void inplace_impl(A &a, T* ptr, const container_detail::index_tuple<IdxPack...>&) | 619 void inplace_impl(Allocator &a, T* ptr, const container_detail::index_tuple<IdxPack...>&) |
616 { | 620 { |
617 allocator_traits<A>::construct | 621 allocator_traits<Allocator>::construct |
618 (a, ptr, ::boost::forward<Args>(container_detail::get<IdxPack>(args_))...); | 622 (a, ptr, ::boost::forward<Args>(container_detail::get<IdxPack>(args_))...); |
619 } | 623 } |
620 | 624 |
621 container_detail::tuple<Args&...> args_; | 625 container_detail::tuple<Args&...> args_; |
622 }; | 626 }; |
623 | 627 |
624 #else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING | 628 #else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) |
625 | 629 |
626 #define BOOST_PP_LOCAL_MACRO(n) \ | 630 #define BOOST_MOVE_ITERATOR_EMPLACE_FUNCTOR_CODE(N) \ |
627 BOOST_PP_EXPR_IF(n, template <) \ | 631 BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \ |
628 BOOST_PP_ENUM_PARAMS(n, class P) \ | 632 struct emplace_functor##N\ |
629 BOOST_PP_EXPR_IF(n, >) \ | 633 {\ |
630 struct BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \ | 634 explicit emplace_functor##N( BOOST_MOVE_UREF##N )\ |
631 { \ | 635 BOOST_MOVE_COLON##N BOOST_MOVE_FWD_INIT##N{}\ |
632 BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \ | 636 \ |
633 ( BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \ | 637 template<class Allocator, class T>\ |
634 BOOST_PP_EXPR_IF(n, :) BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_INIT, _){} \ | 638 void operator()(Allocator &a, T *ptr)\ |
635 \ | 639 { allocator_traits<Allocator>::construct(a, ptr BOOST_MOVE_I##N BOOST_MOVE_MFWD##N); }\ |
636 template<class A, class T> \ | 640 \ |
637 void operator()(A &a, T *ptr) \ | 641 BOOST_MOVE_MREF##N\ |
638 { \ | 642 };\ |
639 allocator_traits<A>::construct \ | 643 // |
640 (a, ptr BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) ); \ | 644 BOOST_MOVE_ITERATE_0TO9(BOOST_MOVE_ITERATOR_EMPLACE_FUNCTOR_CODE) |
641 } \ | 645 #undef BOOST_MOVE_ITERATOR_EMPLACE_FUNCTOR_CODE |
642 BOOST_PP_REPEAT(n, BOOST_CONTAINER_PP_PARAM_DEFINE, _) \ | |
643 }; \ | |
644 //! | |
645 #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) | |
646 #include BOOST_PP_LOCAL_ITERATE() | |
647 | 646 |
648 #endif | 647 #endif |
649 | 648 |
650 namespace container_detail { | 649 namespace container_detail { |
651 | 650 |
696 struct is_bidirectional_iterator<T, false> | 695 struct is_bidirectional_iterator<T, false> |
697 { | 696 { |
698 static const bool value = false; | 697 static const bool value = false; |
699 }; | 698 }; |
700 | 699 |
700 template<class IINodeType> | |
701 struct iiterator_node_value_type { | |
702 typedef typename IINodeType::value_type type; | |
703 }; | |
704 | |
701 template<class IIterator> | 705 template<class IIterator> |
702 struct iiterator_types | 706 struct iiterator_types |
703 { | 707 { |
704 typedef typename IIterator::value_type it_value_type; | 708 typedef typename IIterator::value_type it_value_type; |
705 typedef typename it_value_type::value_type value_type; | 709 typedef typename iiterator_node_value_type<it_value_type>::type value_type; |
706 typedef typename std::iterator_traits<IIterator>::pointer it_pointer; | 710 typedef typename boost::container::iterator_traits<IIterator>::pointer it_pointer; |
707 typedef typename std::iterator_traits<IIterator>::difference_type difference_type; | 711 typedef typename boost::container::iterator_traits<IIterator>::difference_type difference_type; |
708 typedef typename ::boost::intrusive::pointer_traits<it_pointer>:: | 712 typedef typename ::boost::intrusive::pointer_traits<it_pointer>:: |
709 template rebind_pointer<value_type>::type pointer; | 713 template rebind_pointer<value_type>::type pointer; |
710 typedef typename ::boost::intrusive::pointer_traits<it_pointer>:: | 714 typedef typename ::boost::intrusive::pointer_traits<it_pointer>:: |
711 template rebind_pointer<const value_type>::type const_pointer; | 715 template rebind_pointer<const value_type>::type const_pointer; |
712 typedef typename ::boost::intrusive:: | 716 typedef typename ::boost::intrusive:: |
715 pointer_traits<const_pointer>::reference const_reference; | 719 pointer_traits<const_pointer>::reference const_reference; |
716 typedef typename IIterator::iterator_category iterator_category; | 720 typedef typename IIterator::iterator_category iterator_category; |
717 }; | 721 }; |
718 | 722 |
719 template<class IIterator, bool IsConst> | 723 template<class IIterator, bool IsConst> |
720 struct std_iterator | 724 struct iterator_types |
721 { | 725 { |
722 typedef typename std::iterator | 726 typedef typename ::boost::container::iterator |
723 < typename iiterator_types<IIterator>::iterator_category | 727 < typename iiterator_types<IIterator>::iterator_category |
724 , typename iiterator_types<IIterator>::value_type | 728 , typename iiterator_types<IIterator>::value_type |
725 , typename iiterator_types<IIterator>::difference_type | 729 , typename iiterator_types<IIterator>::difference_type |
726 , typename iiterator_types<IIterator>::const_pointer | 730 , typename iiterator_types<IIterator>::const_pointer |
727 , typename iiterator_types<IIterator>::const_reference> type; | 731 , typename iiterator_types<IIterator>::const_reference> type; |
728 }; | 732 }; |
729 | 733 |
730 template<class IIterator> | 734 template<class IIterator> |
731 struct std_iterator<IIterator, false> | 735 struct iterator_types<IIterator, false> |
732 { | 736 { |
733 typedef typename std::iterator | 737 typedef typename ::boost::container::iterator |
734 < typename iiterator_types<IIterator>::iterator_category | 738 < typename iiterator_types<IIterator>::iterator_category |
735 , typename iiterator_types<IIterator>::value_type | 739 , typename iiterator_types<IIterator>::value_type |
736 , typename iiterator_types<IIterator>::difference_type | 740 , typename iiterator_types<IIterator>::difference_type |
737 , typename iiterator_types<IIterator>::pointer | 741 , typename iiterator_types<IIterator>::pointer |
738 , typename iiterator_types<IIterator>::reference> type; | 742 , typename iiterator_types<IIterator>::reference> type; |
739 }; | 743 }; |
740 | 744 |
741 template<class IIterator, bool IsConst> | 745 template<class IIterator, bool IsConst> |
742 class iterator | 746 class iterator_from_iiterator |
743 : public std_iterator<IIterator, IsConst>::type | 747 { |
744 { | 748 typedef typename iterator_types<IIterator, IsConst>::type types_t; |
745 typedef typename std_iterator<IIterator, IsConst>::type types_t; | |
746 | 749 |
747 public: | 750 public: |
748 typedef typename types_t::value_type value_type; | 751 typedef typename types_t::pointer pointer; |
749 typedef typename types_t::pointer pointer; | 752 typedef typename types_t::reference reference; |
750 typedef typename types_t::reference reference; | 753 typedef typename types_t::difference_type difference_type; |
751 | 754 typedef typename types_t::iterator_category iterator_category; |
752 iterator() | 755 typedef typename types_t::value_type value_type; |
756 | |
757 iterator_from_iiterator() | |
753 {} | 758 {} |
754 | 759 |
755 explicit iterator(IIterator iit) BOOST_CONTAINER_NOEXCEPT | 760 explicit iterator_from_iiterator(IIterator iit) BOOST_NOEXCEPT_OR_NOTHROW |
756 : m_iit(iit) | 761 : m_iit(iit) |
757 {} | 762 {} |
758 | 763 |
759 iterator(iterator<IIterator, false> const& other) BOOST_CONTAINER_NOEXCEPT | 764 iterator_from_iiterator(iterator_from_iiterator<IIterator, false> const& other) BOOST_NOEXCEPT_OR_NOTHROW |
760 : m_iit(other.get()) | 765 : m_iit(other.get()) |
761 {} | 766 {} |
762 | 767 |
763 iterator& operator++() BOOST_CONTAINER_NOEXCEPT | 768 iterator_from_iiterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW |
764 { ++this->m_iit; return *this; } | 769 { ++this->m_iit; return *this; } |
765 | 770 |
766 iterator operator++(int) BOOST_CONTAINER_NOEXCEPT | 771 iterator_from_iiterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW |
767 { | 772 { |
768 iterator result (*this); | 773 iterator_from_iiterator result (*this); |
769 ++this->m_iit; | 774 ++this->m_iit; |
770 return result; | 775 return result; |
771 } | 776 } |
772 | 777 |
773 iterator& operator--() BOOST_CONTAINER_NOEXCEPT | 778 iterator_from_iiterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW |
774 { | 779 { |
775 //If the iterator is not a bidirectional iterator, operator-- should not exist | 780 //If the iterator_from_iiterator is not a bidirectional iterator, operator-- should not exist |
776 BOOST_STATIC_ASSERT((is_bidirectional_iterator<iterator>::value)); | 781 BOOST_STATIC_ASSERT((is_bidirectional_iterator<iterator_from_iiterator>::value)); |
777 --this->m_iit; return *this; | 782 --this->m_iit; return *this; |
778 } | 783 } |
779 | 784 |
780 iterator operator--(int) BOOST_CONTAINER_NOEXCEPT | 785 iterator_from_iiterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW |
781 { | 786 { |
782 iterator result (*this); | 787 iterator_from_iiterator result (*this); |
783 --this->m_iit; | 788 --this->m_iit; |
784 return result; | 789 return result; |
785 } | 790 } |
786 | 791 |
787 friend bool operator== (const iterator& l, const iterator& r) BOOST_CONTAINER_NOEXCEPT | 792 friend bool operator== (const iterator_from_iiterator& l, const iterator_from_iiterator& r) BOOST_NOEXCEPT_OR_NOTHROW |
788 { return l.m_iit == r.m_iit; } | 793 { return l.m_iit == r.m_iit; } |
789 | 794 |
790 friend bool operator!= (const iterator& l, const iterator& r) BOOST_CONTAINER_NOEXCEPT | 795 friend bool operator!= (const iterator_from_iiterator& l, const iterator_from_iiterator& r) BOOST_NOEXCEPT_OR_NOTHROW |
791 { return !(l == r); } | 796 { return !(l == r); } |
792 | 797 |
793 reference operator*() const BOOST_CONTAINER_NOEXCEPT | 798 reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW |
794 { return (*this->m_iit).get_data(); } | 799 { return (*this->m_iit).get_data(); } |
795 | 800 |
796 pointer operator->() const BOOST_CONTAINER_NOEXCEPT | 801 pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW |
797 { return ::boost::intrusive::pointer_traits<pointer>::pointer_to(this->operator*()); } | 802 { return ::boost::intrusive::pointer_traits<pointer>::pointer_to(this->operator*()); } |
798 | 803 |
799 const IIterator &get() const BOOST_CONTAINER_NOEXCEPT | 804 const IIterator &get() const BOOST_NOEXCEPT_OR_NOTHROW |
800 { return this->m_iit; } | 805 { return this->m_iit; } |
801 | 806 |
802 private: | 807 private: |
803 IIterator m_iit; | 808 IIterator m_iit; |
804 }; | 809 }; |
805 | 810 |
806 } //namespace container_detail { | 811 } //namespace container_detail { |
812 | |
813 using ::boost::intrusive::reverse_iterator; | |
814 | |
807 } //namespace container { | 815 } //namespace container { |
808 } //namespace boost { | 816 } //namespace boost { |
809 | 817 |
810 #include <boost/container/detail/config_end.hpp> | 818 #include <boost/container/detail/config_end.hpp> |
811 | 819 |