namespace std {
template<class Container>
class back_insert_iterator {
protected:
Container* container = nullptr;
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;
constexpr back_insert_iterator() noexcept = default;
constexpr explicit back_insert_iterator(Container& x);
constexpr back_insert_iterator& operator=(const typename Container::value_type& value);
constexpr back_insert_iterator& operator=(typename Container::value_type&& value);
constexpr back_insert_iterator& operator*();
constexpr back_insert_iterator& operator++();
constexpr back_insert_iterator operator++(int);
};
}
constexpr explicit back_insert_iterator(Container& x);
Effects:
Initializes
container
with
addressof(x). constexpr back_insert_iterator& operator=(const typename Container::value_type& value);
Effects:
As if by: container->push_back(value);
constexpr back_insert_iterator& operator=(typename Container::value_type&& value);
Effects:
As if by: container->push_back(std::move(value));
constexpr back_insert_iterator& operator*();
constexpr back_insert_iterator& operator++();
constexpr back_insert_iterator operator++(int);
template<class Container>
constexpr back_insert_iterator<Container> back_inserter(Container& x);
Returns:
back_insert_iterator<Container>(x).