match.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright Daniel Wallin 2006.
  2. // Copyright Cromwell D. Enage 2017.
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_PARAMETER_AUX_PP_IMPL_MATCH_HPP
  7. #define BOOST_PARAMETER_AUX_PP_IMPL_MATCH_HPP
  8. #include <boost/parameter/config.hpp>
  9. #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
  10. namespace boost { namespace parameter { namespace aux {
  11. // Recast the ParameterSpec's nested match metafunction
  12. // as a free metafunction.
  13. //
  14. // No more limits set by BOOST_PARAMETER_MAX_ARITY. -- Cromwell D. Enage
  15. template <typename Parameters, typename ...Args>
  16. struct match : Parameters::BOOST_NESTED_TEMPLATE match<Args...>
  17. {
  18. };
  19. }}} // namespace boost::parameter::aux
  20. #else
  21. #include <boost/parameter/aux_/void.hpp>
  22. #include <boost/preprocessor/facilities/intercept.hpp>
  23. #include <boost/preprocessor/repetition/enum_params.hpp>
  24. #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
  25. namespace boost { namespace parameter { namespace aux {
  26. // Recast the ParameterSpec's nested match metafunction
  27. // as a free metafunction.
  28. template <
  29. typename Parameters
  30. BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
  31. BOOST_PARAMETER_MAX_ARITY
  32. , typename A
  33. , = ::boost::parameter::void_ BOOST_PP_INTERCEPT
  34. )
  35. >
  36. struct match
  37. : Parameters::BOOST_NESTED_TEMPLATE match<
  38. BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, A)
  39. >
  40. {
  41. };
  42. }}} // namespace boost::parameter::aux
  43. #endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
  44. #endif // include guard