3rdParty/boost/1.78.0/libs/iostreams/doc/classes/back_inserter.html
back_insert_deviceThe 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.
The Iostream Library allows OutputIterators to be used in many places where Sinks are allowed. However, using boost::iostreams::back_inserter my be somewhat more efficient than using std::back_inserter, since the former uses the function insert to append a sequence of characters in one operation. Furthermore, std::back_insert_iterator is not strictly a model of Sink, so one can write
namespaceio = boost::iostreams;typedefio::stream< io::back_insert_device<std::string> > my_stream
But not
typedefio::stream< std::back_insert_iterator<std::string> > my_stream
<boost/iostreams/device/back_inserter.hpp>
namespaceboost {namespaceiostreams {template<typename[Container](#back_insert_device_template_params)>class[back\_insert\_device](#back_insert_device_template_params){public:typedeftypenameContainer::value_type char_type;typedefsink_tag category;[back\_insert\_device](#back_insert_device_constructor)(Container& cnt);...};template<typename[Container](#back_insert_device_template_params)>[back\_insert\_device](#back_insert_device_template_params)<Container>[back\_inserter](#back_inserter)(Container& cnt);
} }// End namespace boost::io
| | | | Container | - | A C++ standard library sequence type ([ISO], 23.1.1). |
back_insert_device::back_insert_deviceback_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_insertertemplate<typenameContainer>
back_insert_device<Container> back_inserter(Container& cnt);
Returns an instance of back_insert_device for appending to the given container.
© Copyright 2008 CodeRage, LLC
© Copyright 2004-2007 Jonathan Turkanis
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)