Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77336 - trunk/boost
From: lorcaminiti_at_[hidden]
Date: 2012-03-14 14:28:49


Author: lcaminiti
Date: 2012-03-14 14:28:49 EDT (Wed, 14 Mar 2012)
New Revision: 77336
URL: http://svn.boost.org/trac/boost/changeset/77336

Log:
Using MSVC typeof(this) workaround on all MSVC version not just 8.0 because trunk regression tests shown this MSVC bug (which raises error C2355) was not fixed in 9 and later version as originally thought.
Text files modified:
   trunk/boost/scope_exit.hpp | 17 ++++++++++++-----
   1 files changed, 12 insertions(+), 5 deletions(-)

Modified: trunk/boost/scope_exit.hpp
==============================================================================
--- trunk/boost/scope_exit.hpp (original)
+++ trunk/boost/scope_exit.hpp 2012-03-14 14:28:49 EDT (Wed, 14 Mar 2012)
@@ -57,6 +57,15 @@
 # define BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND_01 0
 #endif
 
+// MSVC 7.1=1300, 8.0=1400, 9.0=1500, 10.0=1600 (this workaround was tested at
+// MSVC 8.0 but it might work also for all MVSC >= 7.1).
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) && \
+ !defined(BOOST_TYPEOF_EMULATION) /* doesn't work in typeof-emu mode */
+# define BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_WORKAROUND_01 1
+#else
+# define BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_WORKAROUND_01 0
+#endif
+
 #if !defined(BOOST_NO_LAMBDAS) && !defined(BOOST_SCOPE_EXIT_CONFIG_NO_CPP11)
 # define BOOST_SCOPE_EXIT_AUX_LAMBDAS_01 1
 #else
@@ -198,9 +207,7 @@
 // constant by assigning an enum and use that as type-index-- this only works
 // with the sizeof() approach and not with the typeid() approach. This does not
 // work in typeof emulation mode.
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1300) && /* MSVC 7.1 */ \
- BOOST_WORKAROUND(BOOST_MSVC, <= 1400) && /* MSVC 8.0 */ \
- !defined(BOOST_TYPEOF_EMULATION) /* doesn't work in typeof-emu mode */
+#if BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_WORKAROUND_01
 
 namespace boost { namespace scope_exit { namespace aux {
         namespace msvc_typeof_this {
@@ -265,12 +272,12 @@
             BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_(id) \
>::type new_type;
 
-#else // typeof(this) on other compilers are OK.
+#else // TYPEOF_THIS_WORKAROUND
 
 #define BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, new_type) \
     typedef BOOST_TYPEOF(this) new_type;
 
-#endif // typeof(this)
+#endif // TYPEOF_THIS_WORKAROUND
 
 #if BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND_01
 


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