namespace std {
template<class Container>
class insert_iterator {
protected:
Container* container = nullptr;
ranges::iterator_t<Container> iter = ranges::iterator_t<Container>();
public:
using iterator_category = output_iterator_tag;
using value_type = void;
using difference_type = ptrdiff_t;
using pointer = void;
using reference = void;
using container_type = Container;
insert_iterator() = default;
constexpr insert_iterator(Container& x, ranges::iterator_t<Container> i);
constexpr insert_iterator& operator=(const typename Container::value_type& value);
constexpr insert_iterator& operator=(typename Container::value_type&& value);
constexpr insert_iterator& operator*();
constexpr insert_iterator& operator++();
constexpr insert_iterator& operator++(int);
};
}
constexpr insert_iterator(Container& x, ranges::iterator_t<Container> i);
Effects: Initializes
container
with
addressof(x) and
iter
with
i. constexpr insert_iterator& operator=(const typename Container::value_type& value);
Effects: As if by:
iter = container->insert(iter, value);
++iter;
constexpr insert_iterator& operator=(typename Container::value_type&& value);
Effects: As if by:
iter = container->insert(iter, std::move(value));
++iter;
constexpr insert_iterator& operator*();
constexpr insert_iterator& operator++();
constexpr insert_iterator& operator++(int);
template<class Container>
constexpr insert_iterator<Container>
inserter(Container& x, ranges::iterator_t<Container> i);
Returns: insert_iterator<Container>(x, i).