Hack from Steven Watanabe to implement native typeof for VC8.0

[SVN r36497]
This commit is contained in:
Peder Holt 2006-12-23 09:28:50 +00:00
parent 21ef2c54ec
commit 917725e67b
2 changed files with 38 additions and 5 deletions

View File

@ -1,6 +1,7 @@
// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com
// Copyright (C) 2005 Peder Holt
// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com (VC 6.5,VC 7.1 + counter code)
// Copyright (C) 2005 Peder Holt (VC 7.0 + framework)
// Copyright (C) 2006 Steven Watanabe (VC 8.0)
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
@ -99,6 +100,38 @@ namespace boost
typedef T type;
};
};
#elif BOOST_WORKAROUND(BOOST_MSVC,==1400)
struct msvc_extract_type_default_param {};
template<typename ID, typename T = msvc_extract_type_default_param>
struct msvc_extract_type;
template<typename ID>
struct msvc_extract_type<ID, msvc_extract_type_default_param> {
template<bool>
struct id2type_impl;
typedef id2type_impl<true> id2type;
};
template<typename ID, typename T>
struct msvc_extract_type : msvc_extract_type<ID,msvc_extract_type_default_param>
{
template<>
struct id2type_impl<true> //VC8.0 specific bugfeature
{
typedef T type;
};
template<bool>
struct id2type_impl;
typedef id2type_impl<true> id2type;
};
template<typename T, typename ID>
struct msvc_register_type : msvc_extract_type<ID, T>
{
};
# else
template<typename ID>
struct msvc_extract_type

View File

@ -87,7 +87,7 @@
# else
# error typeof emulation is not supported
# endif
# elif (_MSC_VER == 1310) // 7.1
# elif (_MSC_VER >= 1310) // 7.1, 8.0
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
@ -95,14 +95,14 @@
# include <boost/typeof/msvc/typeof_impl.hpp>
# define MSVC_TYPEOF_HACK
# endif
# else // 8.0
/*# else // 8.0
# ifndef BOOST_TYPEOF_NATIVE
# ifndef BOOST_TYPEOF_EMULATION
# define BOOST_TYPEOF_EMULATION
# endif
# else
# error native typeof is not supported
# endif
# endif*/
# endif
#else //unknown compiler