27 Iterators library [iterators]

27.5 Iterator adaptors [predef.iterators]

27.5.2 Insert iterators [insert.iterators]

27.5.2.2 Class template front_­insert_­iterator [front.insert.iterator]

namespace std {
  template<class Container>
  class front_insert_iterator {
  protected:
    Container* container;

  public:
    using iterator_category = output_iterator_tag;
    using value_type        = void;
    using difference_type   = void;
    using pointer           = void;
    using reference         = void;
    using container_type    = Container;

    explicit front_insert_iterator(Container& x);
    front_insert_iterator& operator=(const typename Container::value_type& value);
    front_insert_iterator& operator=(typename Container::value_type&& value);

    front_insert_iterator& operator*();
    front_insert_iterator& operator++();
    front_insert_iterator  operator++(int);
  };

  template<class Container>
    front_insert_iterator<Container> front_inserter(Container& x);
}

27.5.2.2.1 front_­insert_­iterator operations [front.insert.iter.ops]

explicit front_insert_iterator(Container& x);
Effects: Initializes container with addressof(x).
front_insert_iterator& operator=(const typename Container::value_type& value);
Effects: As if by: container->push_­front(value);
Returns: *this.
front_insert_iterator& operator=(typename Container::value_type&& value);
Effects: As if by: container->push_­front(std​::​move(value));
Returns: *this.
front_insert_iterator& operator*();
Returns: *this.
front_insert_iterator& operator++(); front_insert_iterator operator++(int);
Returns: *this.

27.5.2.2.2 front_­inserter [front.inserter]

template<class Container> front_insert_iterator<Container> front_inserter(Container& x);
Returns: front_­insert_­iterator<Container>(x).