A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4140/ostreambuf.iterator below:

[ostreambuf.iterator]

24.6.4 Class template ostreambuf_iterator [ostreambuf.iterator]
namespace std {
  template <class charT, class traits = char_traits<charT> >
  class ostreambuf_iterator :
    public iterator<output_iterator_tag, void, void, void, void> {
  public:
    typedef charT                         char_type;
    typedef traits                        traits_type;
    typedef basic_streambuf<charT,traits> streambuf_type;
    typedef basic_ostream<charT,traits>   ostream_type;

  public:
    ostreambuf_iterator(ostream_type& s) noexcept;
    ostreambuf_iterator(streambuf_type* s) noexcept;
    ostreambuf_iterator& operator=(charT c);

    ostreambuf_iterator& operator*();
    ostreambuf_iterator& operator++();
    ostreambuf_iterator& operator++(int);
    bool failed() const noexcept;

  private:
    streambuf_type* sbuf_;                  };
}

The class template ostreambuf_iterator writes successive characters onto the output stream from which it was constructed. It is not possible to get a character value out of the output iterator.

24.6.4.1 ostreambuf_iterator constructors [ostreambuf.iter.cons]

ostreambuf_iterator(ostream_type& s) noexcept;

Requires: s.rdbuf() shall not be a null pointer.

Effects: Initializes sbuf_ with s.rdbuf().

ostreambuf_iterator(streambuf_type* s) noexcept;

Requires: s shall not be a null pointer.

Effects: Initializes sbuf_ with s.

24.6.4.2 ostreambuf_iterator operations [ostreambuf.iter.ops]

ostreambuf_iterator<charT,traits>& operator=(charT c);

Effects: If failed() yields false, calls sbuf_->sputc(c); otherwise has no effect.

ostreambuf_iterator<charT,traits>& operator*();

ostreambuf_iterator<charT,traits>& operator++(); ostreambuf_iterator<charT,traits>& operator++(int);

bool failed() const noexcept;

Returns: true if in any prior use of member operator=, the call to sbuf_->sputc() returned traits::eof(); or false otherwise.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4