From 692624965327cef74e1e5ec5bed988045b943c8d Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Sun, 25 Nov 2007 21:16:46 +0000 Subject: [PATCH] Revert to old sizeof based solution for retrieving the type from a typeof hack. This is in order to overcome problems with the code analysis module introduced in Visual Studio 2005. [SVN r41383] --- include/boost/typeof/msvc/typeof_impl.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/boost/typeof/msvc/typeof_impl.hpp b/include/boost/typeof/msvc/typeof_impl.hpp index 1a7c980..2f58c18 100755 --- a/include/boost/typeof/msvc/typeof_impl.hpp +++ b/include/boost/typeof/msvc/typeof_impl.hpp @@ -153,7 +153,7 @@ namespace boost }; }; # endif -# if BOOST_WORKAROUND(BOOST_MSVC,>=1310) +# if BOOST_WORKAROUND(BOOST_MSVC,==1310) template struct msvc_typeid_wrapper { typedef typename msvc_extract_type::id2type id2type; @@ -184,6 +184,7 @@ namespace boost template msvc_register_type typeof_register_type(const T&); + # define BOOST_TYPEOF(expr) \ boost::type_of::msvc_typeid_wrapper::type @@ -239,10 +240,18 @@ struct name {\ { typedef char(*type)[encode_type::value]; }; +# if BOOST_WORKAROUND(BOOST_MSVC,>=1310) + template typename disable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T const&); + template typename enable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T&); +# else template typename sizer::type encode_start(T const&); - +# endif template msvc_register_type typeof_register_type(const T&,Organizer* =0);