boost_no_function_type_spec.ipp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // (C) Copyright John Maddock 2001.
  2. // (C) Copyright Aleksey Gurtovoy 2003.
  3. // (C) Copyright Alisdair Meredith 2006.
  4. // Use, modification and distribution are subject to the
  5. // Boost Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. // See http://www.boost.org/libs/config for most recent version.
  8. // MACRO: BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
  9. // TITLE: template specialisations of function types
  10. // DESCRIPTION: If the compiler cannot handle template specialisations
  11. // for function types
  12. namespace boost_no_function_type_specializations{
  13. template< typename T > struct is_function
  14. {
  15. };
  16. struct X {};
  17. enum Y { value };
  18. // Tesst can declare specializations
  19. typedef is_function< int( int ) > scalar_types;
  20. typedef is_function< X( X ) > user_defined_type;
  21. typedef is_function< int( Y ) > check_enum;
  22. typedef is_function< X( X, int ) > multiple_arguments;
  23. // Partial specialization test
  24. // confirm const, volatile, pointers and references in args
  25. template< typename X, typename Y, typename Z >
  26. struct is_function< X( Y const &, volatile Z * ) >
  27. {
  28. };
  29. int test()
  30. {
  31. return 0;
  32. }
  33. }