From 917725e67b05c5bf6b6e61597a72ef3d6c9a2a9f Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Sat, 23 Dec 2006 09:28:50 +0000 Subject: [PATCH] Hack from Steven Watanabe to implement native typeof for VC8.0 [SVN r36497] --- include/boost/typeof/msvc/typeof_impl.hpp | 37 +++++++++++++++++++++-- include/boost/typeof/typeof.hpp | 6 ++-- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/include/boost/typeof/msvc/typeof_impl.hpp b/include/boost/typeof/msvc/typeof_impl.hpp index 3ce3544..c29b388 100755 --- a/include/boost/typeof/msvc/typeof_impl.hpp +++ b/include/boost/typeof/msvc/typeof_impl.hpp @@ -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 + struct msvc_extract_type; + + template + struct msvc_extract_type { + template + struct id2type_impl; + + typedef id2type_impl id2type; + }; + + template + struct msvc_extract_type : msvc_extract_type + { + template<> + struct id2type_impl //VC8.0 specific bugfeature + { + typedef T type; + }; + template + struct id2type_impl; + + typedef id2type_impl id2type; + }; + + template + struct msvc_register_type : msvc_extract_type + { + }; # else template struct msvc_extract_type diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp index 7228b5c..a124e4c 100755 --- a/include/boost/typeof/typeof.hpp +++ b/include/boost/typeof/typeof.hpp @@ -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 # 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