Function Template copy

Description
Headers
Synopsis

Description

The function template copy reads data from a given model of Source and writes it to a given model of Sink until the end of stream is reached. It then closes both components, using the function template close, and returns the number of characters written.

The size of the temporary buffer used may be supplied as an optional parameter.

There are four overloads of copy to accommodate all combinations of Sources and Sinks, which are passed by const reference, and streams and stream buffers, which are passed by non-const reference.

Headers

<boost/iostreams/copy.hpp>

Synopsis

namespace boost { namespace iostreams {
              
template<typename Source, typename Sink>
std::streamsize
copy( [const] Source& src, [const] Sink& sink,
      std::streamsize buffer_size = default value );

} } // End namespace boost::io