2
0
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:
Christopher Kohlhoff
2023-10-26 00:35:29 +11:00
parent 28ff1e7c2b
commit 5c19f29294
480 changed files with 11478 additions and 22743 deletions

View File

@@ -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