summaryrefslogtreecommitdiff
path: root/boost/xpressive/detail/utility/tracking_ptr.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/xpressive/detail/utility/tracking_ptr.hpp')
-rw-r--r--boost/xpressive/detail/utility/tracking_ptr.hpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/boost/xpressive/detail/utility/tracking_ptr.hpp b/boost/xpressive/detail/utility/tracking_ptr.hpp
index 7f29ba155d..aa88e74523 100644
--- a/boost/xpressive/detail/utility/tracking_ptr.hpp
+++ b/boost/xpressive/detail/utility/tracking_ptr.hpp
@@ -9,7 +9,7 @@
#define BOOST_XPRESSIVE_DETAIL_UTILITY_TRACKING_PTR_HPP_EAN_10_04_2005
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -434,18 +434,25 @@ struct tracking_ptr
return this->impl_->self_;
}
+ // smart-pointer operators
#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
- typedef bool unspecified_bool_type;
+
+ operator bool() const
+ {
+ return this->impl_;
+ }
+
#else
- typedef typename intrusive_ptr<element_type>::unspecified_bool_type unspecified_bool_type;
- #endif
- // smart-pointer operators
+ typedef intrusive_ptr<element_type> tracking_ptr::* unspecified_bool_type;
+
operator unspecified_bool_type() const
{
- return this->impl_;
+ return this->impl_ ? &tracking_ptr::impl_ : 0;
}
+ #endif
+
bool operator !() const
{
return !this->impl_;