blob: 2ceaf26001ee342aad86c395ccdc2ac81068ba68 [file] [log] [blame]
Brian Silvermanfad8f552018-08-04 23:36:19 -07001//////////////////////////////////////////////////////////////////////////////
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
27namespace boost {
28namespace container {
29
30using ::boost::intrusive::iterator_traits;
31using ::boost::intrusive::iterator_distance;
32using ::boost::intrusive::iterator_advance;
33using ::boost::intrusive::iterator;
34using ::boost::intrusive::iterator_enable_if_tag;
35using ::boost::intrusive::iterator_disable_if_tag;
36using ::boost::intrusive::iterator_arrow_result;
37
38template <class Container>
39class back_emplacer
40{
41 private:
42 Container& container;
43
44 public:
45 typedef std::output_iterator_tag iterator_category;
46 typedef void value_type;
47 typedef void difference_type;
48 typedef void pointer;
49 typedef void reference;
50
51 back_emplacer(Container& x)
52 : container(x)
53 {}
54
55 template<class U>
56 back_emplacer& operator=(BOOST_FWD_REF(U) value)
57 {
58 container.emplace_back(boost::forward<U>(value));
59 return *this;
60 }
61 back_emplacer& operator*() { return *this; }
62 back_emplacer& operator++() { return *this; }
63 back_emplacer& operator++(int){ return *this; }
64};
65
66
67} //namespace container {
68} //namespace boost {
69
70#endif //#ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP