Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66379 - sandbox/function/boost/function/detail
From: dsaritz_at_[hidden]
Date: 2010-11-03 09:21:57


Author: psiha
Date: 2010-11-03 09:21:53 EDT (Wed, 03 Nov 2010)
New Revision: 66379
URL: http://svn.boost.org/trac/boost/changeset/66379

Log:
Fixed and refactored the safe_bool<> helper class.
Text files modified:
   sandbox/function/boost/function/detail/safe_bool.hpp | 12 +++++-------
   1 files changed, 5 insertions(+), 7 deletions(-)

Modified: sandbox/function/boost/function/detail/safe_bool.hpp
==============================================================================
--- sandbox/function/boost/function/detail/safe_bool.hpp (original)
+++ sandbox/function/boost/function/detail/safe_bool.hpp 2010-11-03 09:21:53 EDT (Wed, 03 Nov 2010)
@@ -27,9 +27,7 @@
 {
 //------------------------------------------------------------------------------
 
-#if BOOST_WORKAROUND( BOOST_MSVC, >= 1600 )
- #define BOOST_COMPILER_RECOGNIZES_SAFE_BOOL_IDIOM
-#elif (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG)
+#if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG)
     // Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
     #define BOOST_NO_SAFE_BOOL
 #endif
@@ -48,7 +46,7 @@
     typedef void (unspecified_bool_type_helper::*unspecified_bool_type_function) ();
     typedef int unspecified_bool_type_helper::*unspecified_bool_type_data ;
 
- #ifndef BOOST_COMPILER_RECOGNIZES_SAFE_BOOL_IDIOM
+ #ifdef BOOST_NO_FAST_SAFE_BOOL_FROM_DATA_MEMBER
         union fast_safe_bool
         {
             unsigned long plain_pointer_placeholder;
@@ -96,7 +94,7 @@
         }
 
         static
- unspecified_bool_type make_safe_bool_worker( bool const value, mpl::true_ /*use fast-hack version*/ )
+ unspecified_bool_type make_safe_bool_worker( std::size_t const value, mpl::true_ /*use fast-hack version*/ )
         {
             fast_safe_bool const & fastSafeBool( *static_cast<fast_safe_bool const *>( static_cast<void const *>( &value ) ) );
             BOOST_ASSERT
@@ -122,7 +120,7 @@
         {
             return make_safe_bool_worker( value, can_use_fast_bool_hack() );
         }
- #else // BOOST_COMPILER_RECOGNIZES_SAFE_BOOL_IDIOM
+ #else // BOOST_NO_FAST_SAFE_BOOL_FROM_DATA_MEMBER
     public:
         typedef unspecified_bool_type_data type;
 
@@ -136,7 +134,7 @@
         {
             return value ? &unspecified_bool_type_helper::member_data_ : 0;
         }
- #endif // BOOST_COMPILER_RECOGNIZES_SAFE_BOOL_IDIOM
+ #endif // BOOST_NO_FAST_SAFE_BOOL_FROM_DATA_MEMBER
 #else // BOOST_NO_SAFE_BOOL
 public:
     typedef bool unspecified_bool_type;


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