Chris@16: // This header intentionally has no include guards. Chris@16: // Chris@16: // Copyright (c) 2001-2009, 2012 Peter Dimov Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt Chris@16: Chris@16: #if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !defined( BOOST_NO_CXX11_NULLPTR ) Chris@16: Chris@16: explicit operator bool () const BOOST_NOEXCEPT Chris@16: { Chris@16: return px != 0; Chris@16: } Chris@16: Chris@16: #elif ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, < 0x570) ) || defined(__CINT__) Chris@16: Chris@16: operator bool () const BOOST_NOEXCEPT Chris@16: { Chris@16: return px != 0; Chris@16: } Chris@16: Chris@16: #elif defined( _MANAGED ) Chris@16: Chris@16: static void unspecified_bool( this_type*** ) Chris@16: { Chris@16: } Chris@16: Chris@16: typedef void (*unspecified_bool_type)( this_type*** ); Chris@16: Chris@16: operator unspecified_bool_type() const BOOST_NOEXCEPT Chris@16: { Chris@16: return px == 0? 0: unspecified_bool; Chris@16: } Chris@16: Chris@16: #elif \ Chris@16: ( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200) ) || \ Chris@16: ( defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304) ) || \ Chris@16: ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) ) Chris@16: Chris@16: typedef element_type * (this_type::*unspecified_bool_type)() const; Chris@16: Chris@16: operator unspecified_bool_type() const BOOST_NOEXCEPT Chris@16: { Chris@16: return px == 0? 0: &this_type::get; Chris@16: } Chris@16: Chris@16: #else Chris@16: Chris@16: typedef element_type * this_type::*unspecified_bool_type; Chris@16: Chris@16: operator unspecified_bool_type() const BOOST_NOEXCEPT Chris@16: { Chris@16: return px == 0? 0: &this_type::px; Chris@16: } Chris@16: Chris@16: #endif Chris@16: Chris@16: // operator! is redundant, but some compilers need it Chris@16: bool operator! () const BOOST_NOEXCEPT Chris@16: { Chris@16: return px == 0; Chris@16: }