From 24fd5ec8af0a6dfad3747402767953470910e1c2 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 23 May 2017 12:33:31 -0700 Subject: [PATCH] Use BOOST_STATIC_ASSERT fix #380 --- CHANGELOG.md | 1 + include/beast/config.hpp | 2 + include/beast/core/async_result.hpp | 4 +- .../beast/core/detail/integer_sequence.hpp | 21 ++--- include/beast/core/impl/handler_ptr.ipp | 6 +- include/beast/core/impl/static_string.ipp | 4 +- include/beast/core/static_string.hpp | 39 +++----- include/beast/http/basic_parser.hpp | 4 +- include/beast/http/detail/rfc7230.hpp | 16 ++-- include/beast/http/impl/basic_parser.ipp | 6 +- include/beast/http/message_parser.hpp | 2 +- include/beast/zlib/detail/deflate_stream.hpp | 2 +- test/core/buffer_cat.cpp | 44 ++++----- test/core/buffer_prefix.cpp | 16 ++-- test/core/buffer_test.hpp | 2 +- test/core/multi_buffer.cpp | 2 +- test/core/type_traits.cpp | 94 +++++++------------ test/http/message.cpp | 56 +++++------ test/websocket/stream.cpp | 24 ++--- 19 files changed, 142 insertions(+), 203 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81ecab2f..31d3dd4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Version 44 * Tidy up read_size_helper and dynamic buffers * Require Boost 1.58.0 or later * Tidy up and make get_lowest_layer public +* Use BOOST_STATIC_ASSERT -------------------------------------------------------------------------------- diff --git a/include/beast/config.hpp b/include/beast/config.hpp index b87262c7..2454ef26 100644 --- a/include/beast/config.hpp +++ b/include/beast/config.hpp @@ -8,6 +8,8 @@ #ifndef BEAST_CONFIG_HPP #define BEAST_CONFIG_HPP +#include + /* _MSC_VER and _MSC_FULL_VER by version: diff --git a/include/beast/core/async_result.hpp b/include/beast/core/async_result.hpp index 31bd0cc8..36cc2828 100644 --- a/include/beast/core/async_result.hpp +++ b/include/beast/core/async_result.hpp @@ -41,8 +41,8 @@ namespace beast { template class async_result { - static_assert(! std::is_reference< - CompletionToken>::value, ""); + BOOST_STATIC_ASSERT( + ! std::is_reference::value); boost::asio::async_result #include @@ -19,8 +19,7 @@ template struct integer_sequence { using value_type = T; - static_assert (std::is_integral::value, - "std::integer_sequence can only be instantiated with an integral type" ); + BOOST_STATIC_ASSERT(std::is_integral::value); static std::size_t constexpr static_size = sizeof...(Ints); @@ -65,11 +64,8 @@ struct make_integer_sequence_unchecked< template struct make_integer_sequence_checked { - static_assert (std::is_integral::value, - "T must be an integral type"); - - static_assert (N >= 0, - "N must be non-negative"); + BOOST_STATIC_ASSERT(std::is_integral::value); + BOOST_STATIC_ASSERT(N >= 0); using type = typename make_integer_sequence_unchecked< T, N, integer_sequence>::type; @@ -117,11 +113,8 @@ struct integer_sequence_helper; template struct integer_sequence_helper> { - static_assert (std::is_integral::value, - "T must be an integral type"); - - static_assert (N >= 0, - "N must be non-negative"); + BOOST_STATIC_ASSERT(std::is_integral::value); + BOOST_STATIC_ASSERT(N >= 0); using type = integer_sequence (Ints)...>; }; diff --git a/include/beast/core/impl/handler_ptr.ipp b/include/beast/core/impl/handler_ptr.ipp index 82574de6..a882acf9 100644 --- a/include/beast/core/impl/handler_ptr.ipp +++ b/include/beast/core/impl/handler_ptr.ipp @@ -84,8 +84,7 @@ handler_ptr(Handler&& handler, Args&&... args) : p_(new P{std::move(handler), std::forward(args)...}) { - static_assert(! std::is_array::value, - "T must not be an array type"); + BOOST_STATIC_ASSERT(! std::is_array::value); } template @@ -94,8 +93,7 @@ handler_ptr:: handler_ptr(Handler const& handler, Args&&... args) : p_(new P{handler, std::forward(args)...}) { - static_assert(! std::is_array::value, - "T must not be an array type"); + BOOST_STATIC_ASSERT(! std::is_array::value); } template diff --git a/include/beast/core/impl/static_string.ipp b/include/beast/core/impl/static_string.ipp index 7834d1cf..6ad4562a 100644 --- a/include/beast/core/impl/static_string.ipp +++ b/include/beast/core/impl/static_string.ipp @@ -593,9 +593,7 @@ template static_string to_static_string(Integer x) { - static_assert( - std::is_integral::value, - "Integral requirements not met"); + BOOST_STATIC_ASSERT(std::is_integral::value); return detail::to_static_string( x, std::integral_constant::value>{}); diff --git a/include/beast/core/static_string.hpp b/include/beast/core/static_string.hpp index 0f340acf..2a189864 100644 --- a/include/beast/core/static_string.hpp +++ b/include/beast/core/static_string.hpp @@ -820,54 +820,41 @@ private: }; // -// Non-member functions +// Disallowed operations // +// These operations are explicitly deleted since +// there is no reasonable implementation possible. + template void operator+( static_stringconst& lhs, - static_stringconst& rhs) -{ - static_assert(sizeof(CharT) == -1, - "operator+ is not available"); -} + static_stringconst& rhs) = delete; template void operator+(CharT const* lhs, - static_stringconst& rhs ) -{ - static_assert(sizeof(CharT) == -1, - "operator+ is not available"); -} + static_stringconst& rhs) = delete; template void operator+(CharT lhs, - static_string const& rhs) -{ - static_assert(sizeof(CharT) == -1, - "operator+ is not available"); -} + static_string const& rhs) = delete; template void operator+(static_string const& lhs, - CharT const* rhs ) -{ - static_assert(sizeof(CharT) == -1, - "operator+ is not available"); -} + CharT const* rhs) = delete; template void operator+(static_string const& lhs, - CharT rhs ) -{ - static_assert(sizeof(CharT) == -1, - "operator+ is not available"); -} + CharT rhs) = delete; + +// +// Non-member functions +// template diff --git a/include/beast/http/basic_parser.hpp b/include/beast/http/basic_parser.hpp index fad52ee6..8d4633a5 100644 --- a/include/beast/http/basic_parser.hpp +++ b/include/beast/http/basic_parser.hpp @@ -458,7 +458,7 @@ public: body() const { // This function not available when isDirect==true - static_assert(! isDirect, ""); + BOOST_STATIC_ASSERT(! isDirect); return body_; } @@ -476,7 +476,7 @@ public: chunk_extension() const { // This function not available when isDirect==true - static_assert(! isDirect, ""); + BOOST_STATIC_ASSERT(! isDirect); return ext_; } diff --git a/include/beast/http/detail/rfc7230.hpp b/include/beast/http/detail/rfc7230.hpp index e60655e7..b00cc448 100644 --- a/include/beast/http/detail/rfc7230.hpp +++ b/include/beast/http/detail/rfc7230.hpp @@ -45,7 +45,7 @@ is_alpha(char c) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 224 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 240 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return tab[static_cast(c)]; } @@ -72,7 +72,7 @@ is_text(char c) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 224 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 240 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return tab[static_cast(c)]; } @@ -104,7 +104,7 @@ is_tchar(char c) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 224 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 240 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return tab[static_cast(c)]; } @@ -133,7 +133,7 @@ is_qdchar(char c) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 224 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 240 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return tab[static_cast(c)]; } @@ -163,7 +163,7 @@ is_qpchar(char c) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 224 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 240 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return tab[static_cast(c)]; } @@ -199,7 +199,7 @@ to_field_char(char c) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return tab[static_cast(c)]; } @@ -229,7 +229,7 @@ to_value_char(char c) 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, // 224 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 // 240 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return static_cast(tab[static_cast(c)]); } @@ -256,7 +256,7 @@ unhex(char c) -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 224 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // 240 }; - static_assert(sizeof(tab) == 256, ""); + BOOST_STATIC_ASSERT(sizeof(tab) == 256); return tab[static_cast(c)]; } diff --git a/include/beast/http/impl/basic_parser.ipp b/include/beast/http/impl/basic_parser.ipp index 36400c73..01bc7535 100644 --- a/include/beast/http/impl/basic_parser.ipp +++ b/include/beast/http/impl/basic_parser.ipp @@ -120,7 +120,7 @@ basic_parser:: copy_body(DynamicBuffer& buffer) { // This function not available when isDirect==false - static_assert(isDirect, ""); + BOOST_STATIC_ASSERT(isDirect); using boost::asio::buffer_copy; using boost::asio::buffer_size; @@ -173,7 +173,7 @@ prepare_body(boost::optional< MutableBufferSequence>& buffers, std::size_t limit) { // This function not available when isDirect==false - static_assert(isDirect, ""); + BOOST_STATIC_ASSERT(isDirect); BOOST_ASSERT(limit > 0); BOOST_ASSERT( @@ -202,7 +202,7 @@ basic_parser:: commit_body(std::size_t n) { // This function not available when isDirect==false - static_assert(isDirect, ""); + BOOST_STATIC_ASSERT(isDirect); BOOST_ASSERT(f_ & flagOnBody); impl().on_commit(n); diff --git a/include/beast/http/message_parser.hpp b/include/beast/http/message_parser.hpp index 506dd246..ce1c5690 100644 --- a/include/beast/http/message_parser.hpp +++ b/include/beast/http/message_parser.hpp @@ -226,7 +226,7 @@ private: on_data(string_view const& s, error_code& ec) { - static_assert(! Body::reader::is_direct, ""); + BOOST_STATIC_ASSERT(! Body::reader::is_direct); r_->write(s, ec); } diff --git a/include/beast/zlib/detail/deflate_stream.hpp b/include/beast/zlib/detail/deflate_stream.hpp index 5ae0869d..1e29298d 100644 --- a/include/beast/zlib/detail/deflate_stream.hpp +++ b/include/beast/zlib/detail/deflate_stream.hpp @@ -133,7 +133,7 @@ protected: static std::uint16_t constexpr maxMatch = 258; // Can't change minMatch without also changing code, see original zlib - static_assert(minMatch==3, ""); + BOOST_STATIC_ASSERT(minMatch == 3); // end of block literal code static std::uint16_t constexpr END_BLOCK = 256; diff --git a/test/core/buffer_cat.cpp b/test/core/buffer_cat.cpp index b9f2d932..c9a173f3 100644 --- a/test/core/buffer_cat.cpp +++ b/test/core/buffer_cat.cpp @@ -216,50 +216,38 @@ public: }; // Check is_all_const_buffer_sequence - static_assert( - detail::is_all_const_buffer_sequence< - const_buffers_1 - >::value, ""); - static_assert( - detail::is_all_const_buffer_sequence< - const_buffers_1, const_buffers_1 - >::value, ""); - static_assert( - detail::is_all_const_buffer_sequence< - mutable_buffers_1 - >::value, ""); - static_assert( - detail::is_all_const_buffer_sequence< - mutable_buffers_1, mutable_buffers_1 - >::value, ""); - static_assert( - detail::is_all_const_buffer_sequence< - const_buffers_1, mutable_buffers_1 - >::value, ""); - static_assert( - ! detail::is_all_const_buffer_sequence< - const_buffers_1, mutable_buffers_1, int - >::value, ""); + BOOST_STATIC_ASSERT( + detail::is_all_const_buffer_sequence::value); + BOOST_STATIC_ASSERT( + detail::is_all_const_buffer_sequence::value); + BOOST_STATIC_ASSERT( + detail::is_all_const_buffer_sequence::value); + BOOST_STATIC_ASSERT( + detail::is_all_const_buffer_sequence::value); + BOOST_STATIC_ASSERT( + detail::is_all_const_buffer_sequence::value); + BOOST_STATIC_ASSERT( + ! detail::is_all_const_buffer_sequence::value); // Ensure that concatenating mutable buffer // sequences results in a mutable buffer sequence - static_assert(std::is_same< + BOOST_STATIC_ASSERT(std::is_same< mutable_buffer, decltype(buffer_cat( std::declval(), std::declval(), std::declval() - ))::value_type>::value, ""); + ))::value_type>::value); // Ensure that concatenating mixed buffer // sequences results in a const buffer sequence. - static_assert(std::is_same< + BOOST_STATIC_ASSERT(std::is_same< const_buffer, decltype(buffer_cat( std::declval(), std::declval(), std::declval() - ))::value_type>::value, ""); + ))::value_type>::value); testBufferCat(); testIterators(); diff --git a/test/core/buffer_prefix.cpp b/test/core/buffer_prefix.cpp index 1cfee4ed..c7d2f65d 100644 --- a/test/core/buffer_prefix.cpp +++ b/test/core/buffer_prefix.cpp @@ -16,24 +16,24 @@ namespace beast { -static_assert( +BOOST_STATIC_ASSERT( std::is_same()))>::value, ""); + std::declval()))>::value); -static_assert( +BOOST_STATIC_ASSERT( is_const_buffer_sequence()))>::value, ""); + std::declval()))>::value); -static_assert( +BOOST_STATIC_ASSERT( std::is_same()))>::value, ""); -static_assert( + std::declval()))>::value); +BOOST_STATIC_ASSERT( is_mutable_buffer_sequence()))>::value, ""); + std::declval()))>::value); class buffer_prefix_test : public beast::unit_test::suite { diff --git a/test/core/buffer_test.hpp b/test/core/buffer_test.hpp index 2a275cc2..ba10a7cb 100644 --- a/test/core/buffer_test.hpp +++ b/test/core/buffer_test.hpp @@ -108,7 +108,7 @@ void check_read_size_helper() { static_assert(has_read_size_helper::trait::value, - "Missing read_size_helper for dynamic buffer"); + "Missing read_size_helper for dynamic buffer"); } } // test diff --git a/test/core/multi_buffer.cpp b/test/core/multi_buffer.cpp index 80e7b1b2..ee9c486c 100644 --- a/test/core/multi_buffer.cpp +++ b/test/core/multi_buffer.cpp @@ -21,7 +21,7 @@ namespace beast { -static_assert(is_dynamic_buffer::value, ""); +BOOST_STATIC_ASSERT(is_dynamic_buffer::value); class multi_buffer_test : public beast::unit_test::suite { diff --git a/test/core/type_traits.cpp b/test/core/type_traits.cpp index 063d135e..a68215cd 100644 --- a/test/core/type_traits.cpp +++ b/test/core/type_traits.cpp @@ -37,26 +37,13 @@ struct is_invocable_udt3 #ifndef __INTELLISENSE__ // VFALCO Fails to compile with Intellisense -static_assert(is_invocable< - is_invocable_udt1, void(int)>::value, ""); - -static_assert(! is_invocable< - is_invocable_udt1, void(void)>::value, ""); - -static_assert(is_invocable< - is_invocable_udt2, int(int)>::value, ""); - -static_assert(! is_invocable< - is_invocable_udt2, int(void)>::value, ""); - -static_assert(! is_invocable< - is_invocable_udt2, void(void)>::value, ""); - -static_assert(is_invocable< - is_invocable_udt3, int(int)>::value, ""); - -static_assert(! is_invocable< - is_invocable_udt3 const, int(int)>::value, ""); +BOOST_STATIC_ASSERT(is_invocable::value); +BOOST_STATIC_ASSERT(is_invocable::value); +BOOST_STATIC_ASSERT(is_invocable::value); +BOOST_STATIC_ASSERT(! is_invocable::value); +BOOST_STATIC_ASSERT(! is_invocable::value); +BOOST_STATIC_ASSERT(! is_invocable::value); +BOOST_STATIC_ASSERT(! is_invocable::value); #endif // @@ -86,29 +73,14 @@ struct F4 get_lowest_layer::type; }; -static_assert(std::is_same< - get_lowest_layer::type, F1>::value, ""); - -static_assert(std::is_same< - get_lowest_layer::type, F2>::value, ""); - -static_assert(std::is_same< - get_lowest_layer>::type, F1>::value, ""); - -static_assert(std::is_same< - get_lowest_layer>::type, F2>::value, ""); - -static_assert(std::is_same< - get_lowest_layer>::type, F1>::value, ""); - -static_assert(std::is_same< - get_lowest_layer>::type, F2>::value, ""); - -static_assert(std::is_same< - get_lowest_layer>>::type, F1>::value, ""); - -static_assert(std::is_same< - get_lowest_layer>>::type, F2>::value, ""); +BOOST_STATIC_ASSERT(std::is_same::type, F1>::value); +BOOST_STATIC_ASSERT(std::is_same::type, F2>::value); +BOOST_STATIC_ASSERT(std::is_same>::type, F1>::value); +BOOST_STATIC_ASSERT(std::is_same>::type, F2>::value); +BOOST_STATIC_ASSERT(std::is_same>::type, F1>::value); +BOOST_STATIC_ASSERT(std::is_same>::type, F2>::value); +BOOST_STATIC_ASSERT(std::is_same>>::type, F1>::value); +BOOST_STATIC_ASSERT(std::is_same>>::type, F2>::value); } // (anonymous) @@ -122,11 +94,11 @@ namespace { struct T {}; -static_assert(is_const_buffer_sequence::value, ""); -static_assert(! is_const_buffer_sequence::value, ""); +BOOST_STATIC_ASSERT(is_const_buffer_sequence::value); +BOOST_STATIC_ASSERT(! is_const_buffer_sequence::value); -static_assert(is_mutable_buffer_sequence::value, ""); -static_assert(! is_mutable_buffer_sequence::value, ""); +BOOST_STATIC_ASSERT(is_mutable_buffer_sequence::value); +BOOST_STATIC_ASSERT(! is_mutable_buffer_sequence::value); } // (anonymous) @@ -143,8 +115,8 @@ struct H } // anonymous -static_assert(is_completion_handler::value, ""); -static_assert(! is_completion_handler::value, ""); +BOOST_STATIC_ASSERT(is_completion_handler::value); +BOOST_STATIC_ASSERT(! is_completion_handler::value); // // stream concepts @@ -154,19 +126,19 @@ static_assert(! is_completion_handler::value, ""); using stream_type = boost::asio::ip::tcp::socket; -static_assert(has_get_io_service::value, ""); -static_assert(is_async_read_stream::value, ""); -static_assert(is_async_write_stream::value, ""); -static_assert(is_async_stream::value, ""); -static_assert(is_sync_read_stream::value, ""); -static_assert(is_sync_write_stream::value, ""); -static_assert(is_sync_stream::value, ""); +BOOST_STATIC_ASSERT(has_get_io_service::value); +BOOST_STATIC_ASSERT(is_async_read_stream::value); +BOOST_STATIC_ASSERT(is_async_write_stream::value); +BOOST_STATIC_ASSERT(is_async_stream::value); +BOOST_STATIC_ASSERT(is_sync_read_stream::value); +BOOST_STATIC_ASSERT(is_sync_write_stream::value); +BOOST_STATIC_ASSERT(is_sync_stream::value); -static_assert(! has_get_io_service::value, ""); -static_assert(! is_async_read_stream::value, ""); -static_assert(! is_async_write_stream::value, ""); -static_assert(! is_sync_read_stream::value, ""); -static_assert(! is_sync_write_stream::value, ""); +BOOST_STATIC_ASSERT(! has_get_io_service::value); +BOOST_STATIC_ASSERT(! is_async_read_stream::value); +BOOST_STATIC_ASSERT(! is_async_write_stream::value); +BOOST_STATIC_ASSERT(! is_sync_read_stream::value); +BOOST_STATIC_ASSERT(! is_sync_write_stream::value); //} // (anonymous) diff --git a/test/http/message.cpp b/test/http/message.cpp index a650d593..fb576748 100644 --- a/test/http/message.cpp +++ b/test/http/message.cpp @@ -73,39 +73,39 @@ public: void testMessage() { - static_assert(std::is_constructible< - message>::value, ""); + BOOST_STATIC_ASSERT(std::is_constructible< + message>::value); - static_assert(std::is_constructible< - message, Arg1>::value, ""); + BOOST_STATIC_ASSERT(std::is_constructible< + message, Arg1>::value); - static_assert(std::is_constructible< - message, Arg1 const>::value, ""); + BOOST_STATIC_ASSERT(std::is_constructible< + message, Arg1 const>::value); - static_assert(std::is_constructible< - message, Arg1 const&>::value, ""); + BOOST_STATIC_ASSERT(std::is_constructible< + message, Arg1 const&>::value); - static_assert(std::is_constructible< - message, Arg1&&>::value, ""); + BOOST_STATIC_ASSERT(std::is_constructible< + message, Arg1&&>::value); - static_assert(! std::is_constructible< - message>::value, ""); + BOOST_STATIC_ASSERT(! std::is_constructible< + message>::value); - static_assert(std::is_constructible< + BOOST_STATIC_ASSERT(std::is_constructible< message, - Arg1, fields::allocator_type>::value, ""); + Arg1, fields::allocator_type>::value); - static_assert(std::is_constructible< + BOOST_STATIC_ASSERT(std::is_constructible< message, std::piecewise_construct_t, - std::tuple>::value, ""); + std::tuple>::value); - static_assert(std::is_constructible< + BOOST_STATIC_ASSERT(std::is_constructible< message, std::piecewise_construct_t, - std::tuple>::value, ""); + std::tuple>::value); - static_assert(std::is_constructible< + BOOST_STATIC_ASSERT(std::is_constructible< message, std::piecewise_construct_t, - std::tuple, std::tuple>::value, ""); + std::tuple, std::tuple>::value); { Arg1 arg1; @@ -171,16 +171,16 @@ public: { { using req_type = request_header; - static_assert(std::is_copy_constructible::value, ""); - static_assert(std::is_move_constructible::value, ""); - static_assert(std::is_copy_assignable::value, ""); - static_assert(std::is_move_assignable::value, ""); + BOOST_STATIC_ASSERT(std::is_copy_constructible::value); + BOOST_STATIC_ASSERT(std::is_move_constructible::value); + BOOST_STATIC_ASSERT(std::is_copy_assignable::value); + BOOST_STATIC_ASSERT(std::is_move_assignable::value); using res_type = response_header; - static_assert(std::is_copy_constructible::value, ""); - static_assert(std::is_move_constructible::value, ""); - static_assert(std::is_copy_assignable::value, ""); - static_assert(std::is_move_assignable::value, ""); + BOOST_STATIC_ASSERT(std::is_copy_constructible::value); + BOOST_STATIC_ASSERT(std::is_move_constructible::value); + BOOST_STATIC_ASSERT(std::is_copy_assignable::value); + BOOST_STATIC_ASSERT(std::is_move_assignable::value); } { diff --git a/test/websocket/stream.cpp b/test/websocket/stream.cpp index 2cbbd3f5..d9dfc84a 100644 --- a/test/websocket/stream.cpp +++ b/test/websocket/stream.cpp @@ -1837,23 +1837,23 @@ public: void run() override { - static_assert(std::is_constructible< - stream, boost::asio::io_service&>::value, ""); + BOOST_STATIC_ASSERT(std::is_constructible< + stream, boost::asio::io_service&>::value); - static_assert(std::is_move_constructible< - stream>::value, ""); + BOOST_STATIC_ASSERT(std::is_move_constructible< + stream>::value); - static_assert(std::is_move_assignable< - stream>::value, ""); + BOOST_STATIC_ASSERT(std::is_move_assignable< + stream>::value); - static_assert(std::is_constructible< - stream, socket_type&>::value, ""); + BOOST_STATIC_ASSERT(std::is_constructible< + stream, socket_type&>::value); - static_assert(std::is_move_constructible< - stream>::value, ""); + BOOST_STATIC_ASSERT(std::is_move_constructible< + stream>::value); - static_assert(! std::is_move_assignable< - stream>::value, ""); + BOOST_STATIC_ASSERT(! std::is_move_assignable< + stream>::value); log << "sizeof(websocket::stream) == " << sizeof(websocket::stream) << std::endl;