New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
operator_bool.hpp in vendors/XIOS/current/extern/boost/include/boost/smart_ptr/detail – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/smart_ptr/detail/operator_bool.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1//  This header intentionally has no include guards.
2//
3//  Copyright (c) 2001-2009 Peter Dimov
4//
5//  Distributed under the Boost Software License, Version 1.0.
6//  See accompanying file LICENSE_1_0.txt or copy at
7//  http://www.boost.org/LICENSE_1_0.txt
8
9#if ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, < 0x570) ) || defined(__CINT__)
10
11    operator bool () const
12    {
13        return px != 0;
14    }
15
16#elif defined( _MANAGED )
17
18    static void unspecified_bool( this_type*** )
19    {
20    }
21
22    typedef void (*unspecified_bool_type)( this_type*** );
23
24    operator unspecified_bool_type() const // never throws
25    {
26        return px == 0? 0: unspecified_bool;
27    }
28
29#elif \
30    ( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200) ) || \
31    ( defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304) ) || \
32    ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) )
33
34    typedef T * (this_type::*unspecified_bool_type)() const;
35
36    operator unspecified_bool_type() const // never throws
37    {
38        return px == 0? 0: &this_type::get;
39    }
40
41#else
42
43    typedef T * this_type::*unspecified_bool_type;
44
45    operator unspecified_bool_type() const // never throws
46    {
47        return px == 0? 0: &this_type::px;
48    }
49
50#endif
51
52    // operator! is redundant, but some compilers need it
53    bool operator! () const // never throws
54    {
55        return px == 0;
56    }
Note: See TracBrowser for help on using the repository browser.