is_completion_handler, type_traits.hpp are deprecated (API Change):

* is_completion_handler is deprecated
* type_traits.hpp is a deprecated include

These items will be removed in the next version

* Include the new header file for the types needed:
  - stream_traits.hpp
  - file_base.hpp
* Use std::is_invocable instead of is_completion_handler
This commit is contained in:
Vinnie Falco committed 2019-02-05 14:16:30 -08:00
1 parent 11c708e29d
commit adcd4bc0c9
41 files changed
+20 -105

No files matched your search

@@ -12,7 +12,6 @@
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/_experimental/core/detail/flat_stream.hpp>
#include <boost/asio/async_result.hpp>
#include <cstdlib>
@@ -12,8 +12,8 @@
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/buffer.hpp>
#include <type_traits>
namespace boost {
@@ -13,7 +13,6 @@
#include <boost/beast/core/bind_handler.hpp>
#include <boost/beast/core/flat_buffer.hpp>
#include <boost/beast/core/string.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/websocket/role.hpp>
#include <boost/beast/_experimental/test/fail_count.hpp>
#include <boost/asio/async_result.hpp>
-1
View File
@@ -45,6 +45,5 @@
#include <boost/beast/core/string.hpp>
#include <boost/beast/core/string_param.hpp>
#include <boost/beast/core/timeout_stream.hpp>
#include <boost/beast/core/type_traits.hpp>
#endif
@@ -13,7 +13,6 @@
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/detail/timeout_stream_base.hpp>
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/basic_stream_socket.hpp>
#include <boost/asio/connect.hpp>
@@ -11,7 +11,6 @@
#define BOOST_BEAST_BIND_HANDLER_HPP
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/bind_handler.hpp>
#include <type_traits>
#include <utility>
@@ -65,12 +64,6 @@ detail::bind_wrapper<
#endif
bind_handler(Handler&& handler, Args&&... args)
{
#if 0
// Can't do this because of placeholders
static_assert(is_completion_handler<
Handler, void(Args...)>::value,
"Handler requirements not met");
#endif
return detail::bind_wrapper<
typename std::decay<Handler>::type,
typename std::decay<Args>::type...>(
@@ -14,7 +14,6 @@
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/multi_buffer.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/io_context.hpp>
@@ -133,10 +133,10 @@ struct is_contiguous_container<T, E, void_t<
expected by the initiating function,
*/
#define BOOST_BEAST_HANDLER_INIT(type, sig) \
static_assert(boost::beast::is_completion_handler< \
static_assert(::boost::beast::detail::is_invocable< \
BOOST_ASIO_HANDLER_TYPE(type, sig), sig>::value, \
"CompletionHandler signature requirements not met"); \
net::async_completion<type, sig> init{handler}
::boost::beast::net::async_completion<type, sig> init{handler}
} // detail
} // beast
@@ -15,7 +15,7 @@
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/read_size.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/type_traits.hpp>
#include <boost/asio/post.hpp>
#include <boost/throw_exception.hpp>
@@ -123,7 +123,7 @@ async_write_some(
static_assert(net::is_const_buffer_sequence<
ConstBufferSequence>::value,
"ConstBufferSequence requirements not met");
static_assert(is_completion_handler<WriteHandler,
static_assert(detail::is_invocable<WriteHandler,
void(error_code, std::size_t)>::value,
"WriteHandler requirements not met");
return next_layer_.async_write_some(buffers,
@@ -10,6 +10,7 @@
#ifndef BOOST_BEAST_IMPL_READ_SIZE_HPP
#define BOOST_BEAST_IMPL_READ_SIZE_HPP
#include <boost/asio/buffer.hpp>
#include <boost/assert.hpp>
#include <stdexcept>
#include <type_traits>
-1
View File
@@ -11,7 +11,6 @@
#define BOOST_BEAST_WRITE_OSTREAM_HPP
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/ostream.hpp>
#include <type_traits>
#include <streambuf>
-1
View File
@@ -11,7 +11,6 @@
#define BOOST_BEAST_READ_SIZE_HELPER_HPP
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/throw_exception.hpp>
namespace boost {
+9 -15
View File
@@ -10,40 +10,32 @@
#ifndef BOOST_BEAST_TYPE_TRAITS_HPP
#define BOOST_BEAST_TYPE_TRAITS_HPP
#include <boost/beast/core/detail/config.hpp>
#ifndef BOOST_BEAST_DOXYGEN
BOOST_PRAGMA_MESSAGE("<boost/beast/core/type_traits.hpp> is DEPRECATED and will be removed in a future release.")
#include <boost/beast/core/file_base.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/detail/is_invocable.hpp>
#include <boost/beast/core/detail/type_traits.hpp>
#include <boost/asio/buffer.hpp>
#include <type_traits>
#include <boost/config/pragma_message.hpp>
#include <type_traits.hpp>
namespace boost {
namespace beast {
//------------------------------------------------------------------------------
//
// Handler concepts
//
//------------------------------------------------------------------------------
/** Determine if `T` meets the requirements of @b CompletionHandler.
This trait checks whether a type meets the requirements for a completion
handler, and is also callable with the specified signature.
Metafunctions are used to perform compile time checking of template
types. This type will be `std::true_type` if `T` meets the requirements,
else the type will be `std::false_type`.
@par Example
Use with `static_assert`:
@code
struct handler
{
void operator()(error_code&);
};
static_assert(is_completion_handler<handler, void(error_code&)>::value,
"Not a completion handler");
@endcode
@@ -61,3 +53,5 @@ using is_completion_handler = std::integral_constant<bool,
} // boost
#endif
#endif
@@ -12,7 +12,6 @@
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/buffer_size.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/buffer.hpp>
#include <boost/beast/http/error.hpp>
#include <boost/beast/http/message.hpp>
@@ -10,7 +10,6 @@
#ifndef BOOST_BEAST_HTTP_DETAIL_CHUNK_ENCODE_HPP
#define BOOST_BEAST_HTTP_DETAIL_CHUNK_ENCODE_HPP
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/http/type_traits.hpp>
#include <boost/asio/buffer.hpp>
#include <algorithm>
@@ -12,7 +12,6 @@
#include <boost/beast/core/buffer_size.hpp>
#include <boost/beast/core/static_string.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/clamp.hpp>
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/http/error.hpp>
@@ -15,7 +15,6 @@
#include <boost/beast/core/async_op_base.hpp>
#include <boost/beast/core/bind_handler.hpp>
#include <boost/beast/core/buffers_range.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/clamp.hpp>
#include <boost/beast/http/serializer.hpp>
#include <boost/asio/async_result.hpp>
-1
View File
@@ -16,7 +16,6 @@
#include <boost/beast/core/buffers_range.hpp>
#include <boost/beast/core/ostream.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/asio/coroutine.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/write.hpp>
-1
View File
@@ -15,7 +15,6 @@
#include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/string.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/variant.hpp>
#include <boost/beast/http/message.hpp>
#include <boost/beast/http/chunk_encode.hpp>
-1
View File
@@ -13,7 +13,6 @@
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/string.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/http/detail/type_traits.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/optional.hpp>
@@ -15,7 +15,6 @@
#include <boost/beast/core/async_op_base.hpp>
#include <boost/beast/core/flat_static_buffer.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/config.hpp>
#include <boost/asio/coroutine.hpp>
#include <boost/asio/post.hpp>
@@ -17,7 +17,6 @@
#include <boost/beast/http/write.hpp>
#include <boost/beast/core/async_op_base.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/asio/coroutine.hpp>
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
@@ -13,7 +13,6 @@
#include <boost/beast/core/async_op_base.hpp>
#include <boost/beast/core/bind_handler.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/websocket/detail/frame.hpp>
#include <boost/asio/coroutine.hpp>
#include <boost/asio/post.hpp>
@@ -19,7 +19,6 @@
#include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/flat_static_buffer.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/buffer.hpp>
#include <boost/beast/core/detail/clamp.hpp>
#include <boost/beast/core/detail/config.hpp>
@@ -23,7 +23,6 @@
#include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/flat_static_buffer.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/clamp.hpp>
#include <boost/beast/core/detail/type_traits.hpp>
#include <boost/asio/bind_executor.hpp>
@@ -13,7 +13,7 @@
#include <boost/beast/core/async_op_base.hpp>
#include <boost/beast/core/bind_handler.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/type_traits.hpp>
#include <boost/asio/coroutine.hpp>
#include <boost/asio/post.hpp>
#include <memory>
@@ -168,7 +168,7 @@ async_teardown(
net::ip::tcp::socket& socket,
TeardownHandler&& handler)
{
static_assert(beast::is_completion_handler<
static_assert(beast::detail::is_invocable<
TeardownHandler, void(error_code)>::value,
"TeardownHandler requirements not met");
detail::teardown_tcp_op<typename std::decay<
@@ -20,7 +20,6 @@
#include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/flat_static_buffer.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/clamp.hpp>
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/websocket/detail/frame.hpp>