|
Boost-Commit : |
From: peder.holt_at_[hidden]
Date: 2007-11-25 16:16:46
Author: burbelgruff
Date: 2007-11-25 16:16:46 EST (Sun, 25 Nov 2007)
New Revision: 41383
URL: http://svn.boost.org/trac/boost/changeset/41383
Log:
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.
Text files modified:
trunk/boost/typeof/msvc/typeof_impl.hpp | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
Modified: trunk/boost/typeof/msvc/typeof_impl.hpp
==============================================================================
--- trunk/boost/typeof/msvc/typeof_impl.hpp (original)
+++ trunk/boost/typeof/msvc/typeof_impl.hpp 2007-11-25 16:16:46 EST (Sun, 25 Nov 2007)
@@ -153,7 +153,7 @@
};
};
# endif
-# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
+# if BOOST_WORKAROUND(BOOST_MSVC,==1310)
template<const std::type_info& ref_type_info>
struct msvc_typeid_wrapper {
typedef typename msvc_extract_type<msvc_typeid_wrapper>::id2type id2type;
@@ -184,6 +184,7 @@
template<typename Organizer, typename T>
msvc_register_type<T,Organizer> typeof_register_type(const T&);
+
# define BOOST_TYPEOF(expr) \
boost::type_of::msvc_typeid_wrapper<typeid(boost::type_of::encode_start(expr))>::type
@@ -239,10 +240,18 @@
{
typedef char(*type)[encode_type<T>::value];
};
+# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
+ template<typename T> typename disable_if<
+ typename is_function<T>::type,
+ typename sizer<T>::type>::type encode_start(T const&);
+ template<typename T> typename enable_if<
+ typename is_function<T>::type,
+ typename sizer<T>::type>::type encode_start(T&);
+# else
template<typename T>
typename sizer<T>::type encode_start(T const&);
-
+# endif
template<typename Organizer, typename T>
msvc_register_type<T,Organizer> typeof_register_type(const T&,Organizer* =0);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk