mpl_interop_test1.cpp 649 B

123456789101112131415161718192021222324252627282930
  1. // (C) Copyright John Maddock 2000.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #include <boost/type_traits/is_void.hpp>
  6. template <class T>
  7. int dispatch_test_imp(const boost::mpl::bool_<true>&)
  8. {
  9. return 0;
  10. }
  11. template <class T>
  12. int dispatch_test_imp(const boost::mpl::bool_<false>&)
  13. {
  14. return 1;
  15. }
  16. template <class T>
  17. int dispatch_test()
  18. {
  19. return dispatch_test_imp<T>(boost::is_void<T>());
  20. }
  21. int main()
  22. {
  23. return (dispatch_test<int>() == 1) && (dispatch_test<void>() == 0) ? 0 : 1;
  24. }