make_strand is in net::

This commit is contained in:
Vinnie Falco committed 2019-03-02 07:33:57 -08:00
1 parent dfd3752c23
commit fca4b3ae10
32 files changed
+58 -121

No files matched your search

-1
View File
@@ -36,7 +36,6 @@
#include <boost/beast/core/flat_stream.hpp>
#include <boost/beast/core/handler_ptr.hpp>
#include <boost/beast/core/make_printable.hpp>
#include <boost/beast/core/make_strand.hpp>
#include <boost/beast/core/multi_buffer.hpp>
#include <boost/beast/core/ostream.hpp>
#include <boost/beast/core/rate_policy.hpp>
-60
View File
@@ -1,60 +0,0 @@
//
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail 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)
//
// Official repository: https://github.com/boostorg/beast
//
#ifndef BOOST_BEAST_MAKE_STRAND_HPP
#define BOOST_BEAST_MAKE_STRAND_HPP
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/stream_traits.hpp>
#include <boost/asio/is_executor.hpp>
#include <boost/asio/strand.hpp>
#include <type_traits>
namespace boost {
namespace beast {
/** Return a strand usable with the specified execution context.
*/
#if BOOST_BEAST_DOXYGEN
template<class ExecutionContext>
__see_below__
#else
template<class ExecutionContext
,class = typename std::enable_if<
has_get_executor<ExecutionContext>::value &&
std::is_convertible<
ExecutionContext&,
net::execution_context&>::value>::type
>
net::strand<executor_type<ExecutionContext>>
#endif
make_strand(ExecutionContext& context)
{
return net::strand<executor_type<
ExecutionContext>>{context.get_executor()};
}
/** Return a strand usable with the specified executor.
*/
template<class Executor
#if ! BOOST_BEAST_DOXYGEN
, class = typename
net::is_executor<Executor>::type
#endif
>
net::strand<Executor>
make_strand(Executor const& ex)
{
return net::strand<Executor>{ex};
}
} // beast
} // boost
#endif