mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
@@ -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
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -8,6 +8,8 @@
|
||||
#ifndef BEAST_CONFIG_HPP
|
||||
#define BEAST_CONFIG_HPP
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
/*
|
||||
_MSC_VER and _MSC_FULL_VER by version:
|
||||
|
||||
|
@@ -41,8 +41,8 @@ namespace beast {
|
||||
template<class CompletionToken, class Signature>
|
||||
class async_result
|
||||
{
|
||||
static_assert(! std::is_reference<
|
||||
CompletionToken>::value, "");
|
||||
BOOST_STATIC_ASSERT(
|
||||
! std::is_reference<CompletionToken>::value);
|
||||
|
||||
boost::asio::async_result<typename
|
||||
boost::asio::handler_type<CompletionToken,
|
||||
|
@@ -5,8 +5,8 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BEAST_DETAIL_INTEGER_SEQUENCE_H_INCLUDED
|
||||
#define BEAST_DETAIL_INTEGER_SEQUENCE_H_INCLUDED
|
||||
#ifndef BEAST_DETAIL_INTEGER_SEQUENCE_HPP
|
||||
#define BEAST_DETAIL_INTEGER_SEQUENCE_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
@@ -19,8 +19,7 @@ template<class T, T... Ints>
|
||||
struct integer_sequence
|
||||
{
|
||||
using value_type = T;
|
||||
static_assert (std::is_integral<T>::value,
|
||||
"std::integer_sequence can only be instantiated with an integral type" );
|
||||
BOOST_STATIC_ASSERT(std::is_integral<T>::value);
|
||||
|
||||
static std::size_t constexpr static_size = sizeof...(Ints);
|
||||
|
||||
@@ -65,11 +64,8 @@ struct make_integer_sequence_unchecked<
|
||||
template<class T, T N>
|
||||
struct make_integer_sequence_checked
|
||||
{
|
||||
static_assert (std::is_integral<T>::value,
|
||||
"T must be an integral type");
|
||||
|
||||
static_assert (N >= 0,
|
||||
"N must be non-negative");
|
||||
BOOST_STATIC_ASSERT(std::is_integral<T>::value);
|
||||
BOOST_STATIC_ASSERT(N >= 0);
|
||||
|
||||
using type = typename make_integer_sequence_unchecked<
|
||||
T, N, integer_sequence<T>>::type;
|
||||
@@ -117,11 +113,8 @@ struct integer_sequence_helper;
|
||||
template<class T, T N, std::size_t... Ints>
|
||||
struct integer_sequence_helper<T, N, index_tuple<Ints...>>
|
||||
{
|
||||
static_assert (std::is_integral<T>::value,
|
||||
"T must be an integral type");
|
||||
|
||||
static_assert (N >= 0,
|
||||
"N must be non-negative");
|
||||
BOOST_STATIC_ASSERT(std::is_integral<T>::value);
|
||||
BOOST_STATIC_ASSERT(N >= 0);
|
||||
|
||||
using type = integer_sequence<T, static_cast<T> (Ints)...>;
|
||||
};
|
||||
|
@@ -84,8 +84,7 @@ handler_ptr(Handler&& handler, Args&&... args)
|
||||
: p_(new P{std::move(handler),
|
||||
std::forward<Args>(args)...})
|
||||
{
|
||||
static_assert(! std::is_array<T>::value,
|
||||
"T must not be an array type");
|
||||
BOOST_STATIC_ASSERT(! std::is_array<T>::value);
|
||||
}
|
||||
|
||||
template<class T, class Handler>
|
||||
@@ -94,8 +93,7 @@ handler_ptr<T, Handler>::
|
||||
handler_ptr(Handler const& handler, Args&&... args)
|
||||
: p_(new P{handler, std::forward<Args>(args)...})
|
||||
{
|
||||
static_assert(! std::is_array<T>::value,
|
||||
"T must not be an array type");
|
||||
BOOST_STATIC_ASSERT(! std::is_array<T>::value);
|
||||
}
|
||||
|
||||
template<class T, class Handler>
|
||||
|
@@ -593,9 +593,7 @@ template<class Integer>
|
||||
static_string<detail::max_digits(sizeof(Integer))>
|
||||
to_static_string(Integer x)
|
||||
{
|
||||
static_assert(
|
||||
std::is_integral<Integer>::value,
|
||||
"Integral requirements not met");
|
||||
BOOST_STATIC_ASSERT(std::is_integral<Integer>::value);
|
||||
return detail::to_static_string(
|
||||
x, std::integral_constant<bool,
|
||||
std::is_signed<Integer>::value>{});
|
||||
|
@@ -820,54 +820,41 @@ private:
|
||||
};
|
||||
|
||||
//
|
||||
// Non-member functions
|
||||
// Disallowed operations
|
||||
//
|
||||
|
||||
// These operations are explicitly deleted since
|
||||
// there is no reasonable implementation possible.
|
||||
|
||||
template<std::size_t N, std::size_t M, class CharT, class Traits>
|
||||
void
|
||||
operator+(
|
||||
static_string<N, CharT, Traits>const& lhs,
|
||||
static_string<M, CharT, Traits>const& rhs)
|
||||
{
|
||||
static_assert(sizeof(CharT) == -1,
|
||||
"operator+ is not available");
|
||||
}
|
||||
static_string<M, CharT, Traits>const& rhs) = delete;
|
||||
|
||||
template<std::size_t N, class CharT, class Traits>
|
||||
void
|
||||
operator+(CharT const* lhs,
|
||||
static_string<N, CharT, Traits>const& rhs )
|
||||
{
|
||||
static_assert(sizeof(CharT) == -1,
|
||||
"operator+ is not available");
|
||||
}
|
||||
static_string<N, CharT, Traits>const& rhs) = delete;
|
||||
|
||||
template<std::size_t N, class CharT, class Traits>
|
||||
void
|
||||
operator+(CharT lhs,
|
||||
static_string<N, CharT, Traits> const& rhs)
|
||||
{
|
||||
static_assert(sizeof(CharT) == -1,
|
||||
"operator+ is not available");
|
||||
}
|
||||
static_string<N, CharT, Traits> const& rhs) = delete;
|
||||
|
||||
template<std::size_t N, class CharT, class Traits>
|
||||
void
|
||||
operator+(static_string<N, CharT, Traits> const& lhs,
|
||||
CharT const* rhs )
|
||||
{
|
||||
static_assert(sizeof(CharT) == -1,
|
||||
"operator+ is not available");
|
||||
}
|
||||
CharT const* rhs) = delete;
|
||||
|
||||
template<std::size_t N, class CharT, class Traits>
|
||||
void
|
||||
operator+(static_string<N, CharT, Traits> const& lhs,
|
||||
CharT rhs )
|
||||
{
|
||||
static_assert(sizeof(CharT) == -1,
|
||||
"operator+ is not available");
|
||||
}
|
||||
CharT rhs) = delete;
|
||||
|
||||
//
|
||||
// Non-member functions
|
||||
//
|
||||
|
||||
template<std::size_t N, std::size_t M,
|
||||
class CharT, class Traits>
|
||||
|
@@ -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_;
|
||||
}
|
||||
|
||||
|
@@ -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<unsigned char>(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<unsigned char>(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<unsigned char>(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<unsigned char>(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<unsigned char>(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<unsigned char>(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<char>(tab[static_cast<unsigned char>(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<unsigned char>(c)];
|
||||
}
|
||||
|
||||
|
@@ -120,7 +120,7 @@ basic_parser<isRequest, isDirect, Derived>::
|
||||
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<isRequest, isDirect, Derived>::
|
||||
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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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<const_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<const_buffers_1, const_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<mutable_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<mutable_buffers_1, mutable_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<const_buffers_1, mutable_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
! detail::is_all_const_buffer_sequence<const_buffers_1, mutable_buffers_1, int>::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<mutable_buffer>(),
|
||||
std::declval<user_defined>(),
|
||||
std::declval<mutable_buffer>()
|
||||
))::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<mutable_buffer>(),
|
||||
std::declval<user_defined>(),
|
||||
std::declval<const_buffer>()
|
||||
))::value_type>::value, "");
|
||||
))::value_type>::value);
|
||||
|
||||
testBufferCat();
|
||||
testIterators();
|
||||
|
@@ -16,24 +16,24 @@
|
||||
|
||||
namespace beast {
|
||||
|
||||
static_assert(
|
||||
BOOST_STATIC_ASSERT(
|
||||
std::is_same<boost::asio::const_buffer, decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::const_buffer>()))>::value, "");
|
||||
std::declval<boost::asio::const_buffer>()))>::value);
|
||||
|
||||
static_assert(
|
||||
BOOST_STATIC_ASSERT(
|
||||
is_const_buffer_sequence<decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::const_buffers_1>()))>::value, "");
|
||||
std::declval<boost::asio::const_buffers_1>()))>::value);
|
||||
|
||||
static_assert(
|
||||
BOOST_STATIC_ASSERT(
|
||||
std::is_same<boost::asio::mutable_buffer, decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::mutable_buffer>()))>::value, "");
|
||||
static_assert(
|
||||
std::declval<boost::asio::mutable_buffer>()))>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
is_mutable_buffer_sequence<decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::mutable_buffers_1>()))>::value, "");
|
||||
std::declval<boost::asio::mutable_buffers_1>()))>::value);
|
||||
|
||||
class buffer_prefix_test : public beast::unit_test::suite
|
||||
{
|
||||
|
@@ -108,7 +108,7 @@ void
|
||||
check_read_size_helper()
|
||||
{
|
||||
static_assert(has_read_size_helper::trait<DynamicBuffer>::value,
|
||||
"Missing read_size_helper for dynamic buffer");
|
||||
"Missing read_size_helper for dynamic buffer");
|
||||
}
|
||||
|
||||
} // test
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace beast {
|
||||
|
||||
static_assert(is_dynamic_buffer<multi_buffer>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_dynamic_buffer<multi_buffer>::value);
|
||||
|
||||
class multi_buffer_test : public beast::unit_test::suite
|
||||
{
|
||||
|
@@ -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<is_invocable_udt1, void(int)>::value);
|
||||
BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt2, int(int)>::value);
|
||||
BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt3, int(int)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt1, void(void)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, int(void)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, void(void)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt3 const, int(int)>::value);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -86,29 +73,14 @@ struct F4
|
||||
get_lowest_layer<next_layer_type>::type;
|
||||
};
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F1>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F2>::type, F2>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F3<F1>>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F3<F2>>::type, F2>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F1>>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F2>>::type, F2>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F3<F1>>>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F3<F2>>>::type, F2>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F1>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F2>::type, F2>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F3<F1>>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F3<F2>>::type, F2>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F1>>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F2>>::type, F2>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F3<F1>>>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F3<F2>>>::type, F2>::value);
|
||||
|
||||
} // (anonymous)
|
||||
|
||||
@@ -122,11 +94,11 @@ namespace {
|
||||
|
||||
struct T {};
|
||||
|
||||
static_assert(is_const_buffer_sequence<detail::ConstBufferSequence>::value, "");
|
||||
static_assert(! is_const_buffer_sequence<T>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_const_buffer_sequence<detail::ConstBufferSequence>::value);
|
||||
BOOST_STATIC_ASSERT(! is_const_buffer_sequence<T>::value);
|
||||
|
||||
static_assert(is_mutable_buffer_sequence<detail::MutableBufferSequence>::value, "");
|
||||
static_assert(! is_mutable_buffer_sequence<T>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_mutable_buffer_sequence<detail::MutableBufferSequence>::value);
|
||||
BOOST_STATIC_ASSERT(! is_mutable_buffer_sequence<T>::value);
|
||||
|
||||
} // (anonymous)
|
||||
|
||||
@@ -143,8 +115,8 @@ struct H
|
||||
|
||||
} // anonymous
|
||||
|
||||
static_assert(is_completion_handler<H, void(int)>::value, "");
|
||||
static_assert(! is_completion_handler<H, void(void)>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_completion_handler<H, void(int)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_completion_handler<H, void(void)>::value);
|
||||
|
||||
//
|
||||
// stream concepts
|
||||
@@ -154,19 +126,19 @@ static_assert(! is_completion_handler<H, void(void)>::value, "");
|
||||
|
||||
using stream_type = boost::asio::ip::tcp::socket;
|
||||
|
||||
static_assert(has_get_io_service<stream_type>::value, "");
|
||||
static_assert(is_async_read_stream<stream_type>::value, "");
|
||||
static_assert(is_async_write_stream<stream_type>::value, "");
|
||||
static_assert(is_async_stream<stream_type>::value, "");
|
||||
static_assert(is_sync_read_stream<stream_type>::value, "");
|
||||
static_assert(is_sync_write_stream<stream_type>::value, "");
|
||||
static_assert(is_sync_stream<stream_type>::value, "");
|
||||
BOOST_STATIC_ASSERT(has_get_io_service<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_async_read_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_async_write_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_async_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_sync_read_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_sync_write_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_sync_stream<stream_type>::value);
|
||||
|
||||
static_assert(! has_get_io_service<int>::value, "");
|
||||
static_assert(! is_async_read_stream<int>::value, "");
|
||||
static_assert(! is_async_write_stream<int>::value, "");
|
||||
static_assert(! is_sync_read_stream<int>::value, "");
|
||||
static_assert(! is_sync_write_stream<int>::value, "");
|
||||
BOOST_STATIC_ASSERT(! has_get_io_service<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_async_read_stream<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_async_write_stream<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_sync_read_stream<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_sync_write_stream<int>::value);
|
||||
|
||||
//} // (anonymous)
|
||||
|
||||
|
@@ -73,39 +73,39 @@ public:
|
||||
void
|
||||
testMessage()
|
||||
{
|
||||
static_assert(std::is_constructible<
|
||||
message<true, default_body, fields>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, default_body, fields>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const&>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1&&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1&&>::value);
|
||||
|
||||
static_assert(! std::is_constructible<
|
||||
message<true, one_arg_body, fields>>::value, "");
|
||||
BOOST_STATIC_ASSERT(! std::is_constructible<
|
||||
message<true, one_arg_body, fields>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>,
|
||||
Arg1, fields::allocator_type>::value, "");
|
||||
Arg1, fields::allocator_type>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, std::piecewise_construct_t,
|
||||
std::tuple<Arg1>>::value, "");
|
||||
std::tuple<Arg1>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, two_arg_body, fields>, std::piecewise_construct_t,
|
||||
std::tuple<Arg1, Arg2>>::value, "");
|
||||
std::tuple<Arg1, Arg2>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, two_arg_body, fields>, std::piecewise_construct_t,
|
||||
std::tuple<Arg1, Arg2>, std::tuple<fields::allocator_type>>::value, "");
|
||||
std::tuple<Arg1, Arg2>, std::tuple<fields::allocator_type>>::value);
|
||||
|
||||
{
|
||||
Arg1 arg1;
|
||||
@@ -171,16 +171,16 @@ public:
|
||||
{
|
||||
{
|
||||
using req_type = request_header;
|
||||
static_assert(std::is_copy_constructible<req_type>::value, "");
|
||||
static_assert(std::is_move_constructible<req_type>::value, "");
|
||||
static_assert(std::is_copy_assignable<req_type>::value, "");
|
||||
static_assert(std::is_move_assignable<req_type>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_copy_constructible<req_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<req_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_copy_assignable<req_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_assignable<req_type>::value);
|
||||
|
||||
using res_type = response_header;
|
||||
static_assert(std::is_copy_constructible<res_type>::value, "");
|
||||
static_assert(std::is_move_constructible<res_type>::value, "");
|
||||
static_assert(std::is_copy_assignable<res_type>::value, "");
|
||||
static_assert(std::is_move_assignable<res_type>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_copy_constructible<res_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<res_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_copy_assignable<res_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_assignable<res_type>::value);
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -1837,23 +1837,23 @@ public:
|
||||
|
||||
void run() override
|
||||
{
|
||||
static_assert(std::is_constructible<
|
||||
stream<socket_type>, boost::asio::io_service&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
stream<socket_type>, boost::asio::io_service&>::value);
|
||||
|
||||
static_assert(std::is_move_constructible<
|
||||
stream<socket_type>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<
|
||||
stream<socket_type>>::value);
|
||||
|
||||
static_assert(std::is_move_assignable<
|
||||
stream<socket_type>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_move_assignable<
|
||||
stream<socket_type>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
stream<socket_type&>, socket_type&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
stream<socket_type&>, socket_type&>::value);
|
||||
|
||||
static_assert(std::is_move_constructible<
|
||||
stream<socket_type&>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<
|
||||
stream<socket_type&>>::value);
|
||||
|
||||
static_assert(! std::is_move_assignable<
|
||||
stream<socket_type&>>::value, "");
|
||||
BOOST_STATIC_ASSERT(! std::is_move_assignable<
|
||||
stream<socket_type&>>::value);
|
||||
|
||||
log << "sizeof(websocket::stream) == " <<
|
||||
sizeof(websocket::stream<boost::asio::ip::tcp::socket&>) << std::endl;
|
||||
|
Reference in New Issue
Block a user