Class Template back_insert_device

Description
Headers
Synopsis

Description

The header <boost/iostreams/device/back_inserter.hpp> contains the definition of the class template back_insert_device — implementing a Sink which appends to a standard library sequence container — as well as the definition of a corresponding object generator, the function template boost::iostreams::back_inserter.

Although the Iostream Library recognizes specializations of the standard library template std::back_insert_iterator as models of Sink, appending to a container using a back_insert_device will often be more efficient since characters may be inserted several at a time.

Headers

<boost/iostreams/device/back_inserter.hpp>

Synopsis

namespace boost { namespace iostreams {

template<typename Container>
class back_insert_device {
public:
    typedef typename Container::value_type  char_type;
    typedef sink_tag                        io_category;
    back_insert_device(Container& cnt);
    ... 
};

template<typename Container>
back_insert_device<Container> back_inserter(Container& cnt);

} } // End namespace boost::io

Template Parameters

Container- A C++ standard library sequence type ([ISO], 23.1.1).

back_insert_device::back_insert_device

    back_insert_device(Container& cnt);

Constructs an instance of back_insert_device for appending to the given container. The given reference must remain valid for the lifetime of the instance of back_insert_device.

back_inserter

template<typename Container>
back_insert_device<Container> back_inserter(Container& cnt);

Returns an instance of back_insert_device for appending to the given container.