make_items.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_ITEMS_HPP
  6. #define BOOST_PARAMETER_AUX_PACK_MAKE_ITEMS_HPP
  7. #include <boost/parameter/aux_/void.hpp>
  8. #include <boost/parameter/aux_/pack/item.hpp>
  9. #include <boost/parameter/config.hpp>
  10. #if defined(BOOST_PARAMETER_CAN_USE_MP11)
  11. #include <boost/mp11/utility.hpp>
  12. #include <type_traits>
  13. #else
  14. #include <boost/mpl/eval_if.hpp>
  15. #include <boost/mpl/identity.hpp>
  16. #include <boost/type_traits/is_same.hpp>
  17. #endif
  18. namespace boost { namespace parameter { namespace aux {
  19. // Creates a item typelist.
  20. template <typename Spec, typename Arg, typename Tail>
  21. #if defined(BOOST_PARAMETER_CAN_USE_MP11)
  22. using make_items = ::boost::mp11::mp_if<
  23. ::std::is_same<Arg,::boost::parameter::void_>
  24. , ::boost::mp11::mp_identity< ::boost::parameter::void_>
  25. , ::boost::parameter::aux::make_item<Spec,Arg,Tail>
  26. >;
  27. #else
  28. struct make_items
  29. : ::boost::mpl::eval_if<
  30. ::boost::is_same<Arg,::boost::parameter::void_>
  31. , ::boost::mpl::identity< ::boost::parameter::void_>
  32. , ::boost::parameter::aux::make_item<Spec,Arg,Tail>
  33. >
  34. {
  35. };
  36. #endif
  37. }}} // namespace boost::parameter::aux
  38. #endif // include guard