make_deduced_items.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_MAKE_DEDUCED_ITEMS_HPP
  6. #define BOOST_PARAMETER_AUX_PACK_MAKE_DEDUCED_ITEMS_HPP
  7. #include <boost/parameter/aux_/void.hpp>
  8. #include <boost/parameter/aux_/pack/deduced_item.hpp>
  9. #include <boost/parameter/deduced.hpp>
  10. #include <boost/parameter/config.hpp>
  11. #if defined(BOOST_PARAMETER_CAN_USE_MP11)
  12. #include <boost/mp11/utility.hpp>
  13. #include <type_traits>
  14. #else
  15. #include <boost/mpl/eval_if.hpp>
  16. #include <boost/mpl/identity.hpp>
  17. #include <boost/type_traits/is_same.hpp>
  18. #endif
  19. namespace boost { namespace parameter { namespace aux {
  20. template <typename Spec, typename Tail>
  21. #if defined(BOOST_PARAMETER_CAN_USE_MP11)
  22. using make_deduced_items = ::boost::mp11::mp_if<
  23. ::std::is_same<Spec,::boost::parameter::void_>
  24. , ::boost::mp11::mp_identity< ::boost::parameter::void_>
  25. , ::boost::mp11::mp_if<
  26. ::boost::parameter::aux::is_deduced<Spec>
  27. , ::boost::parameter::aux::make_deduced_item<Spec,Tail>
  28. , Tail
  29. >
  30. >;
  31. #else
  32. struct make_deduced_items
  33. : ::boost::mpl::eval_if<
  34. ::boost::is_same<Spec,::boost::parameter::void_>
  35. , ::boost::mpl::identity< ::boost::parameter::void_>
  36. , ::boost::mpl::eval_if<
  37. ::boost::parameter::aux::is_deduced<Spec>
  38. , ::boost::parameter::aux::make_deduced_item<Spec,Tail>
  39. , Tail
  40. >
  41. >
  42. {
  43. };
  44. #endif // BOOST_PARAMETER_CAN_USE_MP11
  45. }}} // namespace boost::parameter::aux
  46. #endif // include guard