mirror of
https://github.com/boostorg/asio.git
synced 2026-01-19 04:02:09 +00:00
Require C++11 as the minimum c++ standard.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
// Test that header file is self-contained.
|
||||
#include <boost/asio/bind_executor.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/steady_timer.hpp>
|
||||
#include "unit_test.hpp"
|
||||
@@ -26,24 +27,13 @@
|
||||
# include <boost/asio/steady_timer.hpp>
|
||||
#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_BOOST_BIND)
|
||||
# include <boost/bind/bind.hpp>
|
||||
#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
|
||||
# include <functional>
|
||||
#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
|
||||
|
||||
using namespace boost::asio;
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_BOOST_BIND)
|
||||
namespace bindns = boost;
|
||||
#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
|
||||
namespace bindns = std;
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
|
||||
typedef deadline_timer timer;
|
||||
namespace chronons = boost::posix_time;
|
||||
#elif defined(BOOST_ASIO_HAS_CHRONO)
|
||||
#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
|
||||
typedef steady_timer timer;
|
||||
namespace chronons = boost::asio::chrono;
|
||||
#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
|
||||
@@ -143,37 +133,13 @@ public:
|
||||
typedef void return_type;
|
||||
#endif // !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename Initiation, typename... Args>
|
||||
static void initiate(Initiation initiation,
|
||||
incrementer_token_v2 token, BOOST_ASIO_MOVE_ARG(Args)... args)
|
||||
incrementer_token_v2 token, Args&&... args)
|
||||
{
|
||||
initiation(bindns::bind(&increment, token.count),
|
||||
BOOST_ASIO_MOVE_CAST(Args)(args)...);
|
||||
static_cast<Args&&>(args)...);
|
||||
}
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename Initiation>
|
||||
static void initiate(Initiation initiation, incrementer_token_v2 token)
|
||||
{
|
||||
initiation(bindns::bind(&increment, token.count));
|
||||
}
|
||||
|
||||
#define BOOST_ASIO_PRIVATE_INITIATE_DEF(n) \
|
||||
template <typename Initiation, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
static return_type initiate(Initiation initiation, \
|
||||
incrementer_token_v2 token, BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
|
||||
{ \
|
||||
initiation(bindns::bind(&increment, token.count), \
|
||||
BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \
|
||||
} \
|
||||
/**/
|
||||
BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_INITIATE_DEF)
|
||||
#undef BOOST_ASIO_PRIVATE_INITIATE_DEF
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
};
|
||||
|
||||
} // namespace asio
|
||||
|
||||
Reference in New Issue
Block a user