]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/container/detail/iterator.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / container / detail / iterator.hpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2014-2014.
4 //
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // See http://www.boost.org/libs/container for documentation.
10 //
11 //////////////////////////////////////////////////////////////////////////////
12
13 #ifndef BOOST_CONTAINER_DETAIL_ITERATOR_HPP
14 #define BOOST_CONTAINER_DETAIL_ITERATOR_HPP
15
16 #ifndef BOOST_CONFIG_HPP
17 # include <boost/config.hpp>
18 #endif
19
20 #if defined(BOOST_HAS_PRAGMA_ONCE)
21 # pragma once
22 #endif
23
24 #include <boost/intrusive/detail/iterator.hpp>
25 #include <boost/move/utility_core.hpp>
26 #include <boost/container/detail/mpl.hpp>
27
28 namespace boost {
29 namespace container {
30
31 using ::boost::intrusive::iterator_traits;
32 using ::boost::intrusive::iter_difference;
33 using ::boost::intrusive::iter_category;
34 using ::boost::intrusive::iter_value;
35 using ::boost::intrusive::iter_size;
36 using ::boost::intrusive::iterator_distance;
37 using ::boost::intrusive::iterator_udistance;
38 using ::boost::intrusive::iterator_advance;
39 using ::boost::intrusive::iterator_uadvance;
40 using ::boost::intrusive::iterator;
41 using ::boost::intrusive::iterator_enable_if_tag;
42 using ::boost::intrusive::iterator_disable_if_tag;
43 using ::boost::intrusive::iterator_arrow_result;
44
45 template <class Container>
46 class back_emplacer
47 {
48 private:
49 Container& container;
50
51 public:
52 typedef std::output_iterator_tag iterator_category;
53 typedef void value_type;
54 typedef void difference_type;
55 typedef void pointer;
56 typedef void reference;
57
58 back_emplacer(Container& x)
59 : container(x)
60 {}
61
62 template<class U>
63 back_emplacer& operator=(BOOST_FWD_REF(U) value)
64 {
65 container.emplace_back(boost::forward<U>(value));
66 return *this;
67 }
68 back_emplacer& operator*() { return *this; }
69 back_emplacer& operator++() { return *this; }
70 back_emplacer& operator++(int){ return *this; }
71 };
72
73 #ifndef BOOST_CONTAINER_NO_CXX17_CTAD
74
75 template<class InputIterator>
76 using it_based_non_const_first_type_t = typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type;
77
78 template<class InputIterator>
79 using it_based_const_first_type_t = const typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type;
80
81 template<class InputIterator>
82 using it_based_second_type_t = typename iterator_traits<InputIterator>::value_type::second_type;
83
84 template<class InputIterator>
85 using it_based_value_type_t = typename iterator_traits<InputIterator>::value_type;
86
87 #endif
88
89 } //namespace container {
90 } //namespace boost {
91
92 #endif //#ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP