From 45aaf22acd55d6c6dc0b3fd2f51de92608bff087 Mon Sep 17 00:00:00 2001 From: Damian Jarek Date: Sat, 20 Apr 2019 00:55:52 +0200 Subject: [PATCH] Relax requirements for vector_body: fix: #1567 std::byte is not an arithmetic type, which caused compilation to fail when it was used in vector_body. Signed-off-by: Damian Jarek --- CHANGELOG.md | 1 + include/boost/beast/http/vector_body.hpp | 3 +-- test/beast/http/vector_body.cpp | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e674ac63..8e32a4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Version 253: * Fix async_detect_ssl handler type * member get_executor const-correctness * Fix min/max on MSVC +* Relax requirements for vector_body -------------------------------------------------------------------------------- diff --git a/include/boost/beast/http/vector_body.hpp b/include/boost/beast/http/vector_body.hpp index b44ef0f6..1317ec3f 100644 --- a/include/boost/beast/http/vector_body.hpp +++ b/include/boost/beast/http/vector_body.hpp @@ -39,8 +39,7 @@ template> struct vector_body { private: - static_assert(sizeof(T) == 1 && - std::is_integral::value, + static_assert(sizeof(T) == 1, "T requirements not met"); public: diff --git a/test/beast/http/vector_body.cpp b/test/beast/http/vector_body.cpp index 588df5e8..142d17e1 100644 --- a/test/beast/http/vector_body.cpp +++ b/test/beast/http/vector_body.cpp @@ -9,6 +9,7 @@ // Test that header file is self-contained. #include +#include namespace boost { namespace beast { @@ -18,6 +19,12 @@ BOOST_STATIC_ASSERT(is_body>::value); BOOST_STATIC_ASSERT(is_body_writer>::value); BOOST_STATIC_ASSERT(is_body_reader>::value); +#if __cpp_lib_byte >= 201603 +BOOST_STATIC_ASSERT(is_body>::value); +BOOST_STATIC_ASSERT(is_body_writer>::value); +BOOST_STATIC_ASSERT(is_body_reader>::value); +#endif + } // http } // beast } // boost