New, improved and more portable unspecified bool type. I hope.

[SVN r33987]
This commit is contained in:
Peter Dimov
2006-05-17 22:39:34 +00:00
parent 203764eb51
commit 4fcee64483

View File

@ -323,6 +323,8 @@ public:
// implicit conversion to "bool"
/*
#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
operator bool () const
@ -330,6 +332,23 @@ public:
return px != 0;
}
#elif defined( _MANAGED )
*/
static void unspecified_bool( this_type*** )
{
}
typedef void (*unspecified_bool_type)( this_type*** );
operator unspecified_bool_type() const // never throws
{
return px == 0? 0: unspecified_bool;
}
/*
#elif \
( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200) ) || \
( defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304) )
@ -352,6 +371,8 @@ public:
#endif
*/
// operator! is redundant, but some compilers need it
bool operator! () const // never throws