| 1 | // |
|---|---|
| 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) |
| 3 | // |
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | // |
| 7 | // Official repository: https://github.com/boostorg/beast |
| 8 | // |
| 9 | |
| 10 | #ifndef BOOST_BEAST_IMPL_FLAT_STATIC_BUFFER_HPP |
| 11 | #define BOOST_BEAST_IMPL_FLAT_STATIC_BUFFER_HPP |
| 12 | |
| 13 | namespace boost { |
| 14 | namespace beast { |
| 15 | |
| 16 | template<std::size_t N> |
| 17 | flat_static_buffer<N>:: |
| 18 | flat_static_buffer( |
| 19 | flat_static_buffer const& other) |
| 20 | : flat_static_buffer_base(buf_, N) |
| 21 | { |
| 22 | this->commit(n: net::buffer_copy( |
| 23 | this->prepare(n: other.size()), other.data())); |
| 24 | } |
| 25 | |
| 26 | template<std::size_t N> |
| 27 | auto |
| 28 | flat_static_buffer<N>:: |
| 29 | operator=(flat_static_buffer const& other) -> |
| 30 | flat_static_buffer<N>& |
| 31 | { |
| 32 | if(this == &other) |
| 33 | return *this; |
| 34 | this->consume(n: this->size()); |
| 35 | this->commit(n: net::buffer_copy( |
| 36 | this->prepare(n: other.size()), other.data())); |
| 37 | return *this; |
| 38 | } |
| 39 | |
| 40 | } // beast |
| 41 | } // boost |
| 42 | |
| 43 | #endif |
