msvc_is_class.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright Aleksey Gurtovoy 2000-2004
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. #include <boost/mpl/aux_/config/msvc.hpp>
  12. #include <boost/mpl/aux_/config/workaround.hpp>
  13. #if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
  14. #include <boost/mpl/aux_/msvc_is_class.hpp>
  15. #include <boost/mpl/aux_/test.hpp>
  16. template< typename T > struct A { T x[0]; };
  17. MPL_TEST_CASE()
  18. {
  19. MPL_ASSERT_NOT(( aux::msvc_is_class< int > ));
  20. MPL_ASSERT_NOT(( aux::msvc_is_class< char > ));
  21. MPL_ASSERT_NOT(( aux::msvc_is_class< enum_ > ));
  22. MPL_ASSERT_NOT(( aux::msvc_is_class< char* > ));
  23. MPL_ASSERT_NOT(( aux::msvc_is_class< UDT* > ));
  24. MPL_ASSERT_NOT(( aux::msvc_is_class< UDT& > ));
  25. MPL_ASSERT_NOT(( aux::msvc_is_class< incomplete* > ));
  26. MPL_ASSERT_NOT(( aux::msvc_is_class< incomplete& > ));
  27. MPL_ASSERT_NOT(( aux::msvc_is_class< int[5] > ));
  28. MPL_ASSERT_NOT(( aux::msvc_is_class< void (*)() > ));
  29. MPL_ASSERT_NOT(( aux::msvc_is_class< int (*)(int, char) > ));
  30. MPL_ASSERT(( aux::msvc_is_class< UDT > ));
  31. MPL_ASSERT(( aux::msvc_is_class< incomplete > ));
  32. MPL_ASSERT(( aux::msvc_is_class< abstract > ));
  33. MPL_ASSERT(( aux::msvc_is_class< noncopyable > ));
  34. MPL_ASSERT(( aux::msvc_is_class< A<int> > ));
  35. MPL_ASSERT(( aux::msvc_is_class< A<incomplete> > ));
  36. }
  37. #endif