diff options
Diffstat (limited to 'boost/container/detail/iterator.hpp')
-rw-r--r-- | boost/container/detail/iterator.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/boost/container/detail/iterator.hpp b/boost/container/detail/iterator.hpp index 8538acc161..2ceaf26001 100644 --- a/boost/container/detail/iterator.hpp +++ b/boost/container/detail/iterator.hpp @@ -22,6 +22,7 @@ #endif #include <boost/intrusive/detail/iterator.hpp> +#include <boost/move/utility_core.hpp> namespace boost { namespace container { @@ -34,6 +35,35 @@ using ::boost::intrusive::iterator_enable_if_tag; using ::boost::intrusive::iterator_disable_if_tag; using ::boost::intrusive::iterator_arrow_result; +template <class Container> +class back_emplacer +{ + private: + Container& container; + + public: + typedef std::output_iterator_tag iterator_category; + typedef void value_type; + typedef void difference_type; + typedef void pointer; + typedef void reference; + + back_emplacer(Container& x) + : container(x) + {} + + template<class U> + back_emplacer& operator=(BOOST_FWD_REF(U) value) + { + container.emplace_back(boost::forward<U>(value)); + return *this; + } + back_emplacer& operator*() { return *this; } + back_emplacer& operator++() { return *this; } + back_emplacer& operator++(int){ return *this; } +}; + + } //namespace container { } //namespace boost { |