2 #ifndef BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED
\r
3 #define BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2002-2004
\r
7 // Distributed under the Boost Software License, Version 1.0.
\r
8 // (See accompanying file LICENSE_1_0.txt or copy at
\r
9 // http://www.boost.org/LICENSE_1_0.txt)
\r
11 // See http://www.boost.org/libs/mpl for documentation.
\r
13 // $Id: msvc_is_class.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
14 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
15 // $Revision: 49267 $
\r
17 #include <boost/mpl/if.hpp>
\r
18 #include <boost/mpl/bool.hpp>
\r
19 #include <boost/mpl/aux_/type_wrapper.hpp>
\r
20 #include <boost/mpl/aux_/yes_no.hpp>
\r
22 #include <boost/type_traits/is_reference.hpp>
\r
24 namespace boost { namespace mpl { namespace aux {
\r
26 template< typename T > struct is_class_helper
\r
28 typedef int (T::* type)();
\r
31 // MSVC 6.x-specific lightweight 'is_class' implementation;
\r
32 // Distinguishing feature: does not instantiate the type being tested.
\r
33 template< typename T >
\r
34 struct msvc_is_class_impl
\r
36 template< typename U>
\r
37 static yes_tag test(type_wrapper<U>*, /*typename*/ is_class_helper<U>::type = 0);
\r
38 static no_tag test(void const volatile*, ...);
\r
40 enum { value = sizeof(test((type_wrapper<T>*)0)) == sizeof(yes_tag) };
\r
41 typedef bool_<value> type;
\r
44 // agurt, 17/sep/04: have to check for 'is_reference' upfront to avoid ICEs in
\r
45 // complex metaprograms
\r
46 template< typename T >
\r
47 struct msvc_is_class
\r
51 , msvc_is_class_impl<T>
\r
58 #endif // BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED
\r