Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:38

0001 
0002 #ifndef BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2002-2004
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/if.hpp>
0018 #include <boost/mpl/bool.hpp>
0019 #include <boost/mpl/aux_/type_wrapper.hpp>
0020 #include <boost/mpl/aux_/yes_no.hpp>
0021 
0022 #include <boost/type_traits/is_reference.hpp>
0023 
0024 namespace boost { namespace mpl { namespace aux {
0025 
0026 template< typename T > struct is_class_helper
0027 {
0028     typedef int (T::* type)();
0029 };
0030 
0031 // MSVC 6.x-specific lightweight 'is_class' implementation; 
0032 // Distinguishing feature: does not instantiate the type being tested.
0033 template< typename T >
0034 struct msvc_is_class_impl
0035 {
0036     template< typename U>
0037     static yes_tag  test(type_wrapper<U>*, /*typename*/ is_class_helper<U>::type = 0);
0038     static no_tag   test(void const volatile*, ...);
0039 
0040     enum { value = sizeof(test((type_wrapper<T>*)0)) == sizeof(yes_tag) };
0041     typedef bool_<value> type;
0042 };
0043 
0044 // agurt, 17/sep/04: have to check for 'is_reference' upfront to avoid ICEs in
0045 // complex metaprograms
0046 template< typename T >
0047 struct msvc_is_class
0048     : if_<
0049           is_reference<T>
0050         , false_
0051         , msvc_is_class_impl<T>
0052         >::type
0053 {
0054 };
0055 
0056 }}}
0057 
0058 #endif // BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED