src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp in passenger-6.0.8 vs src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp in passenger-6.0.9
- old
+ new
@@ -1,10 +1,10 @@
//
// impl/read.hpp
// ~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -56,56 +56,56 @@
completion_condition(ec, tmp.total_consumed())))
tmp.consume(s.read_some(tmp.prepare(max_size), ec));
else
break;
}
- return tmp.total_consumed();;
+ return tmp.total_consumed();
}
} // namespace detail
template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
- typename enable_if<
+ typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type*)
+ >::type)
{
return detail::read_buffer_sequence(s, buffers,
boost::asio::buffer_sequence_begin(buffers),
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
}
template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
- typename enable_if<
+ typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type*)
+ >::type)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec);
boost::asio::detail::throw_error(ec, "read");
return bytes_transferred;
}
template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
boost::system::error_code& ec,
- typename enable_if<
+ typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type*)
+ >::type)
{
return read(s, buffers, transfer_all(), ec);
}
template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
- typename enable_if<
+ typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type*)
+ >::type)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read(s, buffers,
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
boost::asio::detail::throw_error(ec, "read");
@@ -117,14 +117,16 @@
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type*)
+ >::type,
+ typename constraint<
+ !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
+ >::type)
{
typename decay<DynamicBuffer_v1>::type b(
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
ec = boost::system::error_code();
@@ -149,14 +151,16 @@
}
template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type*)
+ >::type,
+ typename constraint<
+ !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
+ >::type)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read(s,
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), transfer_all(), ec);
boost::asio::detail::throw_error(ec, "read");
@@ -165,28 +169,32 @@
template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
boost::system::error_code& ec,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type*)
+ >::type,
+ typename constraint<
+ !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
+ >::type)
{
return read(s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
transfer_all(), ec);
}
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type*)
+ >::type,
+ typename constraint<
+ !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
+ >::type)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read(s,
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
@@ -238,13 +246,13 @@
template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type*)
+ >::type)
{
DynamicBuffer_v2& b = buffers;
ec = boost::system::error_code();
std::size_t total_transferred = 0;
@@ -270,13 +278,13 @@
return total_transferred;
}
template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type*)
+ >::type)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read(s,
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), transfer_all(), ec);
boost::asio::detail::throw_error(ec, "read");
@@ -284,25 +292,25 @@
}
template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
boost::system::error_code& ec,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type*)
+ >::type)
{
return read(s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
transfer_all(), ec);
}
template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type*)
+ >::type)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read(s,
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
@@ -563,13 +571,13 @@
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename enable_if<
+ typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type*)
+ >::type)
{
return async_initiate<ReadHandler,
void (boost::system::error_code, std::size_t)>(
detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s), handler,
buffers, BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
@@ -580,13 +588,13 @@
std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename enable_if<
+ typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
- >::type*)
+ >::type)
{
return async_initiate<ReadHandler,
void (boost::system::error_code, std::size_t)>(
detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s),
handler, buffers, transfer_all());
@@ -843,14 +851,16 @@
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type*)
+ >::type,
+ typename constraint<
+ !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
+ >::type)
{
return async_read(s,
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
@@ -863,14 +873,16 @@
void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
- && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
- >::type*)
+ >::type,
+ typename constraint<
+ !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
+ >::type)
{
return async_initiate<ReadHandler,
void (boost::system::error_code, std::size_t)>(
detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
@@ -1165,13 +1177,13 @@
std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type*)
+ >::type)
{
return async_read(s,
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
@@ -1183,12 +1195,12 @@
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename enable_if<
+ typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >::type*)
+ >::type)
{
return async_initiate<ReadHandler,
void (boost::system::error_code, std::size_t)>(
detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),