Функция<boost::asio::buffer_copy>используется для копирования байтов из исходного буфера (или буферной последовательности) в целевой буфер (или буферную последовательность).
std::size_t buffer_copy(
    const mutable_buffer & target,
    const const_buffer & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffer & target,
    const const_buffers_1 & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffer & target,
    const mutable_buffer & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffer & target,
    const mutable_buffers_1 & source);
  » more...
template<
    typename ConstBufferSequence>
std::size_t buffer_copy(
    const mutable_buffer & target,
    const ConstBufferSequence & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const const_buffer & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const const_buffers_1 & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const mutable_buffer & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const mutable_buffers_1 & source);
  » more...
template<
    typename ConstBufferSequence>
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const ConstBufferSequence & source);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const const_buffer & source);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const const_buffers_1 & source);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const mutable_buffer & source);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const mutable_buffers_1 & source);
  » more...
template<
    typename MutableBufferSequence,
    typename ConstBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const ConstBufferSequence & source);
  » more...
std::size_t buffer_copy(
    const mutable_buffer & target,
    const const_buffer & source,
    std::size_t max_bytes_to_copy);
  » more...
std::size_t buffer_copy(
    const mutable_buffer & target,
    const const_buffers_1 & source,
    std::size_t max_bytes_to_copy);
  » more...
std::size_t buffer_copy(
    const mutable_buffer & target,
    const mutable_buffer & source,
    std::size_t max_bytes_to_copy);
  » more...
std::size_t buffer_copy(
    const mutable_buffer & target,
    const mutable_buffers_1 & source,
    std::size_t max_bytes_to_copy);
  » more...
template<
    typename ConstBufferSequence>
std::size_t buffer_copy(
    const mutable_buffer & target,
    const ConstBufferSequence & source,
    std::size_t max_bytes_to_copy);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const const_buffer & source,
    std::size_t max_bytes_to_copy);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const const_buffers_1 & source,
    std::size_t max_bytes_to_copy);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const mutable_buffer & source,
    std::size_t max_bytes_to_copy);
  » more...
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const mutable_buffers_1 & source,
    std::size_t max_bytes_to_copy);
  » more...
template<
    typename ConstBufferSequence>
std::size_t buffer_copy(
    const mutable_buffers_1 & target,
    const ConstBufferSequence & source,
    std::size_t max_bytes_to_copy);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const const_buffer & source,
    std::size_t max_bytes_to_copy);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const const_buffers_1 & source,
    std::size_t max_bytes_to_copy);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const mutable_buffer & source,
    std::size_t max_bytes_to_copy);
  » more...
template<
    typename MutableBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const mutable_buffers_1 & source,
    std::size_t max_bytes_to_copy);
  » more...
template<
    typename MutableBufferSequence,
    typename ConstBufferSequence>
std::size_t buffer_copy(
    const MutableBufferSequence & target,
    const ConstBufferSequence & source,
    std::size_t max_bytes_to_copy);
  » more...
Функция<buffer_copy>доступна в двух формах:
- Форма 2 аргумента:<
buffer_copy(target,source)> 
- Форма из 3 аргументов:<
buffer_copy(target,source,max_bytes_to_copy)> 
 
Обе формы возвращают количество фактически скопированных байтов. Количество скопированных байтов меньше:
- <
buffer_size(target)> 
- <
buffer_size(source)> 
- <
If>Уточняется,<max_bytes_to_copy>. 
 
Это предотвращает переполнение буфера, независимо от размеров буфера, используемого в операции копирования.
Обратите внимание, что<buffer_copy>реализован в терминах<memcpy>, и, следовательно, он не может быть использован для копирования между перекрывающимися областями памяти.
Заголовок:<boost/asio/buffer.hpp>
Удобный заголовок:<boost/asio.hpp>