diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bf6b29d..e216bdf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Version 200 * Don't include OpenSSL for core snippets +* Tidy up msvc-14 workaround in multi_buffer -------------------------------------------------------------------------------- diff --git a/include/boost/beast/core/impl/multi_buffer.hpp b/include/boost/beast/core/impl/multi_buffer.hpp index 8bc73e3c..d1f8469f 100644 --- a/include/boost/beast/core/impl/multi_buffer.hpp +++ b/include/boost/beast/core/impl/multi_buffer.hpp @@ -133,7 +133,7 @@ public: #endif template -template +template class basic_multi_buffer::readable_bytes { basic_multi_buffer const* b_; @@ -149,17 +149,14 @@ class basic_multi_buffer::readable_bytes public: using value_type = typename std::conditional< - IsMutable, + isMutable, net::mutable_buffer, net::const_buffer>::type; class const_iterator; readable_bytes() = delete; -#if ! defined(_MSC_VER) || (_MSC_VER >= 1910) - readable_bytes(readable_bytes const&) = default; - readable_bytes& operator=(readable_bytes const&) = default; -#else +#if BOOST_WORKAROUND(BOOST_MSVC, < 1910) readable_bytes(readable_bytes const& other) : b_(other.b_) { @@ -170,11 +167,14 @@ public: b_ = other.b_; return *this; } +#else + readable_bytes(readable_bytes const&) = default; + readable_bytes& operator=(readable_bytes const&) = default; #endif template< - bool IsMutable_ = IsMutable, - class = typename std::enable_if::type> + bool isMutable_ = isMutable, + class = typename std::enable_if::type> readable_bytes( readable_bytes const& other) noexcept : b_(other.b_) @@ -182,8 +182,8 @@ public: } template< - bool IsMutable_ = IsMutable, - class = typename std::enable_if::type> + bool isMutable_ = isMutable, + class = typename std::enable_if::type> readable_bytes& operator=( readable_bytes const& other) noexcept { @@ -209,10 +209,10 @@ public: //------------------------------------------------------------------------------ template -template +template class basic_multi_buffer:: - readable_bytes:: + readable_bytes:: const_iterator { basic_multi_buffer const* b_ = nullptr; @@ -416,10 +416,10 @@ public: //------------------------------------------------------------------------------ template -template +template auto basic_multi_buffer:: -readable_bytes:: +readable_bytes:: begin() const noexcept -> const_iterator { @@ -427,10 +427,10 @@ begin() const noexcept -> } template -template +template auto basic_multi_buffer:: -readable_bytes:: +readable_bytes:: end() const noexcept -> const_iterator { diff --git a/include/boost/beast/core/multi_buffer.hpp b/include/boost/beast/core/multi_buffer.hpp index c345d137..13e432d9 100644 --- a/include/boost/beast/core/multi_buffer.hpp +++ b/include/boost/beast/core/multi_buffer.hpp @@ -79,7 +79,7 @@ class basic_multi_buffer // contains `element` followed by raw storage bytes. class element; - template + template class readable_bytes; using alloc_traits = @@ -435,11 +435,17 @@ public: std::size_t capacity() const noexcept; - /// Returns a constant buffer sequence representing the readable bytes + /** Returns a constant buffer sequence representing the readable bytes + + @note The sequence may contain multiple contiguous memory regions. + */ const_buffers_type data() const noexcept; - /// Returns a constant buffer sequence representing the readable bytes + /** Returns a constant buffer sequence representing the readable bytes + + @note The sequence may contain multiple contiguous memory regions. + */ const_buffers_type cdata() const noexcept { @@ -448,8 +454,7 @@ public: /** Returns a mutable buffer sequence representing the readable bytes. - @note The sequence may contain zero or more contiguous memory - regions. + @note The sequence may contain multiple contiguous memory regions. */ mutable_data_type data() noexcept;