tag_keyword_arg_ref.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright David Abrahams, Daniel Wallin 2003.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
  6. #define BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
  7. #include <boost/parameter/aux_/unwrap_cv_reference.hpp>
  8. #include <boost/parameter/aux_/tagged_argument.hpp>
  9. #include <boost/parameter/config.hpp>
  10. namespace boost { namespace parameter { namespace aux {
  11. template <
  12. typename Keyword
  13. , typename ActualArg
  14. #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
  15. , typename = typename ::boost::parameter::aux
  16. ::is_cv_reference_wrapper<ActualArg>::type
  17. #endif
  18. >
  19. struct tag_ref
  20. {
  21. typedef ::boost::parameter::aux::tagged_argument<
  22. Keyword
  23. , typename ::boost::parameter::aux
  24. ::unwrap_cv_reference<ActualArg>::type
  25. > type;
  26. };
  27. }}} // namespace boost::parameter::aux_
  28. #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
  29. #include <boost/mpl/bool.hpp>
  30. namespace boost { namespace parameter { namespace aux {
  31. template <typename Keyword, typename ActualArg>
  32. struct tag_ref<Keyword,ActualArg,::boost::mpl::false_>
  33. {
  34. typedef ::boost::parameter::aux
  35. ::tagged_argument<Keyword,ActualArg> type;
  36. };
  37. }}} // namespace boost::parameter::aux_
  38. #endif // Borland workarounds needed.
  39. namespace boost { namespace parameter { namespace aux {
  40. struct tag_keyword_arg_ref
  41. {
  42. template <typename K, typename T>
  43. struct apply
  44. {
  45. typedef typename ::boost::parameter::aux::tag_ref<K,T>::type type;
  46. };
  47. #if defined(BOOST_PARAMETER_CAN_USE_MP11)
  48. template <typename K, typename T>
  49. using fn = typename ::boost::parameter::aux::tag_ref<K,T>::type;
  50. #endif
  51. };
  52. }}} // namespace boost::parameter::aux
  53. #endif // include guard