unmatched_argument.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_UNMATCHED_ARGUMENT_HPP
  6. #define BOOST_PARAMETER_AUX_PACK_UNMATCHED_ARGUMENT_HPP
  7. #include <boost/parameter/config.hpp>
  8. #if defined(BOOST_PARAMETER_CAN_USE_MP11)
  9. #include <type_traits>
  10. #else
  11. #include <boost/mpl/bool.hpp>
  12. #include <boost/mpl/if.hpp>
  13. #include <boost/mpl/assert.hpp>
  14. #include <boost/type_traits/is_same.hpp>
  15. #endif
  16. namespace boost { namespace parameter { namespace aux {
  17. template <typename T>
  18. struct unmatched_argument
  19. {
  20. #if defined(BOOST_PARAMETER_CAN_USE_MP11)
  21. static_assert(::std::is_same<T,void>::value, "T == void");
  22. #else
  23. BOOST_MPL_ASSERT((
  24. typename ::boost::mpl::if_<
  25. ::boost::is_same<T,void>
  26. , ::boost::mpl::true_
  27. , ::boost::mpl::false_
  28. >::type
  29. ));
  30. #endif
  31. typedef int type;
  32. };
  33. }}} // namespace boost::parameter::aux
  34. #endif // include guard