Function Template putback

Overview
Headers
Reference

Overview

The function template putback provides a uniform interface for putting back characters read from models of Peekable, for use in the definitions of Filters.

Headers

<boost/iostreams/operations.hpp>
<boost/iostreams/putback.hpp>

Reference

Description

Attempt to putback a character to a given instance of the template parameter Peekable, returning true for success.

Synopsis

namespace boost { namespace iostreams {
              
    template<typename Peekable>     
    bool putback(Peekable& peekable, typename char_type_of<Peekable>::type c);

} } // End namespace boost::io

Template Parameters

Peekable- A model of Peekable.

Semantics

The semantics of putback depends on the category of Peekable as follows:

category_of<Peekable>::typesemantics
convertible to istream_tag invokes peekable.rdbuf()->putback(c) and returns true if the operation was successful
convertible to streambuf_tag but not to istream_tag invokes peekable.sputbackc(c) and returns true if the operation was successful
convertible to peekable_tag but not to streambuf_tag or istream_tag returns peekable.putback(c)
otherwise compile-time error