File indexing completed on 2025-01-18 09:35:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_GEOMETRY_INDEX_INSERTER_HPP
0012 #define BOOST_GEOMETRY_INDEX_INSERTER_HPP
0013
0014 #include <iterator>
0015
0016
0017
0018
0019
0020 namespace boost { namespace geometry { namespace index {
0021
0022 template <class Container>
0023 class insert_iterator
0024 {
0025 public:
0026 typedef std::output_iterator_tag iterator_category;
0027 typedef void value_type;
0028 typedef void difference_type;
0029 typedef void pointer;
0030 typedef void reference;
0031
0032 typedef Container container_type;
0033
0034 inline explicit insert_iterator(Container & c)
0035 : container(&c)
0036 {}
0037
0038 insert_iterator & operator=(typename Container::value_type const& value)
0039 {
0040 container->insert(value);
0041 return *this;
0042 }
0043
0044 insert_iterator & operator* ()
0045 {
0046 return *this;
0047 }
0048
0049 insert_iterator & operator++ ()
0050 {
0051 return *this;
0052 }
0053
0054 insert_iterator operator++(int)
0055 {
0056 return *this;
0057 }
0058
0059 private:
0060 Container * container;
0061 };
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 template <typename Container>
0076 insert_iterator<Container> inserter(Container & c)
0077 {
0078 return insert_iterator<Container>(c);
0079 }
0080
0081 }}}
0082
0083 #endif