boost_parameter_ext.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright (c) 2009-2016 Vladimir Batov.
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
  4. #ifndef BOOST_PARAMETER_EXT_PRIVATE_HPP
  5. #define BOOST_PARAMETER_EXT_PRIVATE_HPP
  6. #include <boost/parameter/keyword.hpp>
  7. // A Boost.Parameter extension by Andrey Semashev.
  8. // This should really go to Boost.Parameter in the end.
  9. namespace boost { namespace parameter {
  10. // The metafunction, given the type of the arguments pack and the keyword tag,
  11. // returns the corresponding parameter type
  12. template< typename ArgsT, typename KeywordTagT >
  13. struct parameter_type
  14. {
  15. typedef void type;
  16. };
  17. template< typename ArgT, typename KeywordTagT >
  18. struct parameter_type<aux::tagged_argument<KeywordTagT, ArgT>, KeywordTagT>
  19. {
  20. typedef typename aux::tagged_argument< KeywordTagT, ArgT >::value_type type;
  21. };
  22. template< typename KeywordTagT1, typename ArgT, typename KeywordTagT2 >
  23. struct parameter_type< aux::tagged_argument< KeywordTagT1, ArgT >, KeywordTagT2 >
  24. {
  25. typedef void type;
  26. };
  27. template< typename ArgT, typename TailT, typename KeywordTagT >
  28. struct parameter_type<
  29. aux::arg_list<
  30. aux::tagged_argument< KeywordTagT, ArgT >,
  31. TailT
  32. >,
  33. KeywordTagT
  34. >
  35. {
  36. typedef typename aux::tagged_argument< KeywordTagT, ArgT >::value_type type;
  37. };
  38. template< typename KeywordTagT1, typename ArgT, typename TailT, typename KeywordTagT2 >
  39. struct parameter_type<
  40. aux::arg_list<
  41. aux::tagged_argument< KeywordTagT1, ArgT >,
  42. TailT
  43. >,
  44. KeywordTagT2
  45. > :
  46. public parameter_type< TailT, KeywordTagT2 >
  47. {
  48. };
  49. }} // boost::parameter
  50. #endif // BOOST_PARAMETER_EXT_PRIVATE_HPP