Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:27

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/beast
0008 //
0009 
0010 #ifndef BOOST_BEAST_IMPL_STATIC_BUFFER_HPP
0011 #define BOOST_BEAST_IMPL_STATIC_BUFFER_HPP
0012 
0013 #include <boost/asio/buffer.hpp>
0014 #include <stdexcept>
0015 
0016 namespace boost {
0017 namespace beast {
0018 
0019 template<std::size_t N>
0020 static_buffer<N>::
0021 static_buffer(static_buffer const& other) noexcept
0022     : static_buffer_base(buf_, N)
0023 {
0024     this->commit(net::buffer_copy(
0025         this->prepare(other.size()), other.data()));
0026 }
0027 
0028 template<std::size_t N>
0029 auto
0030 static_buffer<N>::
0031 operator=(static_buffer const& other) noexcept ->
0032     static_buffer<N>&
0033 {
0034     if(this == &other)
0035         return *this;
0036     this->consume(this->size());
0037     this->commit(net::buffer_copy(
0038         this->prepare(other.size()), other.data()));
0039     return *this;
0040 }
0041 
0042 } // beast
0043 } // boost
0044 
0045 #endif