variadic_templates.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // detail/variadic_templates.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef BOOST_ASIO_DETAIL_VARIADIC_TEMPLATES_HPP
  11. #define BOOST_ASIO_DETAIL_VARIADIC_TEMPLATES_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/config.hpp>
  16. #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  17. # define BOOST_ASIO_VARIADIC_TPARAMS(n) BOOST_ASIO_VARIADIC_TPARAMS_##n
  18. # define BOOST_ASIO_VARIADIC_TPARAMS_1 \
  19. typename T1
  20. # define BOOST_ASIO_VARIADIC_TPARAMS_2 \
  21. typename T1, typename T2
  22. # define BOOST_ASIO_VARIADIC_TPARAMS_3 \
  23. typename T1, typename T2, typename T3
  24. # define BOOST_ASIO_VARIADIC_TPARAMS_4 \
  25. typename T1, typename T2, typename T3, typename T4
  26. # define BOOST_ASIO_VARIADIC_TPARAMS_5 \
  27. typename T1, typename T2, typename T3, typename T4, typename T5
  28. # define BOOST_ASIO_VARIADIC_TARGS(n) BOOST_ASIO_VARIADIC_TARGS_##n
  29. # define BOOST_ASIO_VARIADIC_TARGS_1 x1
  30. # define BOOST_ASIO_VARIADIC_TARGS_2 x1, x2
  31. # define BOOST_ASIO_VARIADIC_TARGS_3 x1, x2, x3
  32. # define BOOST_ASIO_VARIADIC_TARGS_4 x1, x2, x3, x4
  33. # define BOOST_ASIO_VARIADIC_TARGS_5 x1, x2, x3, x4, x5
  34. # define BOOST_ASIO_VARIADIC_PARAMS(n) BOOST_ASIO_VARIADIC_PARAMS_##n
  35. # define BOOST_ASIO_VARIADIC_PARAMS_1 T1 x1
  36. # define BOOST_ASIO_VARIADIC_PARAMS_2 T1 x1, T2 x2
  37. # define BOOST_ASIO_VARIADIC_PARAMS_3 T1 x1, T2 x2, T3 x3
  38. # define BOOST_ASIO_VARIADIC_PARAMS_4 T1 x1, T2 x2, T3 x3, T4 x4
  39. # define BOOST_ASIO_VARIADIC_PARAMS_5 T1 x1, T2 x2, T3 x3, T4 x4, T5 x5
  40. # define BOOST_ASIO_VARIADIC_ARGS(n) BOOST_ASIO_VARIADIC_ARGS_##n
  41. # define BOOST_ASIO_VARIADIC_ARGS_1 x1
  42. # define BOOST_ASIO_VARIADIC_ARGS_2 x1, x2
  43. # define BOOST_ASIO_VARIADIC_ARGS_3 x1, x2, x3
  44. # define BOOST_ASIO_VARIADIC_ARGS_4 x1, x2, x3, x4
  45. # define BOOST_ASIO_VARIADIC_ARGS_5 x1, x2, x3, x4, x5
  46. # define BOOST_ASIO_VARIADIC_GENERATE(m) m(1) m(2) m(3) m(4) m(5)
  47. #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  48. #endif // BOOST_ASIO_DETAIL_VARIADIC_TEMPLATES_HPP