diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ea010a1..3349aed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 45 + +* Workaround for boost::asio::basic_streambuf type check + +-------------------------------------------------------------------------------- + Version 44 * Use BOOST_THROW_EXCEPTION diff --git a/include/beast/core/detail/type_traits.hpp b/include/beast/core/detail/type_traits.hpp index a992180a..13511848 100644 --- a/include/beast/core/detail/type_traits.hpp +++ b/include/beast/core/detail/type_traits.hpp @@ -345,4 +345,14 @@ public: } // detail } // beast +namespace boost { +namespace asio { + +// for is_dynamic_buffer +template +class basic_streambuf; + +} // asio +} // boost + #endif diff --git a/include/beast/core/type_traits.hpp b/include/beast/core/type_traits.hpp index bf70d34f..87ff89b8 100644 --- a/include/beast/core/type_traits.hpp +++ b/include/beast/core/type_traits.hpp @@ -56,17 +56,12 @@ struct is_dynamic_buffer : std::false_type {}; template struct is_dynamic_buffer() = std::declval().size(), std::declval() = std::declval().max_size(), -#if 0 - // This check is skipped because boost::asio - // types are not up to date with net-ts. std::declval() = std::declval().capacity(), -#endif std::declval().commit(std::declval()), std::declval().consume(std::declval()), (void)0)>> : std::integral_constant { }; + +// Special case for Boost.Asio which doesn't adhere to +// net-ts but still provides a read_size_helper so things work +template +struct is_dynamic_buffer< + boost::asio::basic_streambuf> : std::true_type +{ +}; #endif //------------------------------------------------------------------------------