]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/smart_ptr/detail/operator_bool.hpp
Logo AND Algorithmique Numérique Distribuée

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