From 000c7ae5ac867059314f8a142b242b904d8cfe84 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 25 Sep 2024 12:49:13 +0300 Subject: [PATCH] Remove detail/operator_bool.hpp --- .../boost/smart_ptr/detail/operator_bool.hpp | 18 ------------------ include/boost/smart_ptr/intrusive_ptr.hpp | 6 ++++-- include/boost/smart_ptr/local_shared_ptr.hpp | 6 ++++-- include/boost/smart_ptr/scoped_array.hpp | 6 ++++-- include/boost/smart_ptr/scoped_ptr.hpp | 6 ++++-- include/boost/smart_ptr/shared_array.hpp | 6 ++++-- include/boost/smart_ptr/shared_ptr.hpp | 6 ++++-- 7 files changed, 24 insertions(+), 30 deletions(-) delete mode 100644 include/boost/smart_ptr/detail/operator_bool.hpp diff --git a/include/boost/smart_ptr/detail/operator_bool.hpp b/include/boost/smart_ptr/detail/operator_bool.hpp deleted file mode 100644 index dca171b..0000000 --- a/include/boost/smart_ptr/detail/operator_bool.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// This header intentionally has no include guards. -// -// Copyright (c) 2001-2009, 2012 Peter Dimov -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt - - explicit operator bool () const BOOST_SP_NOEXCEPT - { - return px != 0; - } - - // operator! is redundant, but some compilers need it - bool operator! () const BOOST_SP_NOEXCEPT - { - return px == 0; - } diff --git a/include/boost/smart_ptr/intrusive_ptr.hpp b/include/boost/smart_ptr/intrusive_ptr.hpp index ac181f2..278b8ea 100644 --- a/include/boost/smart_ptr/intrusive_ptr.hpp +++ b/include/boost/smart_ptr/intrusive_ptr.hpp @@ -163,8 +163,10 @@ public: return px; } -// implicit conversion to "bool" -#include + explicit operator bool () const BOOST_SP_NOEXCEPT + { + return px != 0; + } void swap(intrusive_ptr & rhs) BOOST_SP_NOEXCEPT { diff --git a/include/boost/smart_ptr/local_shared_ptr.hpp b/include/boost/smart_ptr/local_shared_ptr.hpp index bf011ef..0675c13 100644 --- a/include/boost/smart_ptr/local_shared_ptr.hpp +++ b/include/boost/smart_ptr/local_shared_ptr.hpp @@ -386,8 +386,10 @@ public: return px; } - // implicit conversion to "bool" -#include + explicit operator bool () const BOOST_SP_NOEXCEPT + { + return px != 0; + } long local_use_count() const BOOST_SP_NOEXCEPT { diff --git a/include/boost/smart_ptr/scoped_array.hpp b/include/boost/smart_ptr/scoped_array.hpp index 43bee79..aa38bfa 100644 --- a/include/boost/smart_ptr/scoped_array.hpp +++ b/include/boost/smart_ptr/scoped_array.hpp @@ -85,8 +85,10 @@ public: return px; } -// implicit conversion to "bool" -#include + explicit operator bool () const BOOST_SP_NOEXCEPT + { + return px != 0; + } void swap(scoped_array & b) BOOST_SP_NOEXCEPT { diff --git a/include/boost/smart_ptr/scoped_ptr.hpp b/include/boost/smart_ptr/scoped_ptr.hpp index 1909496..148d6ec 100644 --- a/include/boost/smart_ptr/scoped_ptr.hpp +++ b/include/boost/smart_ptr/scoped_ptr.hpp @@ -111,8 +111,10 @@ public: return px; } -// implicit conversion to "bool" -#include + explicit operator bool () const BOOST_SP_NOEXCEPT + { + return px != 0; + } void swap(scoped_ptr & b) BOOST_SP_NOEXCEPT { diff --git a/include/boost/smart_ptr/shared_array.hpp b/include/boost/smart_ptr/shared_array.hpp index 2c28fad..24ac89b 100644 --- a/include/boost/smart_ptr/shared_array.hpp +++ b/include/boost/smart_ptr/shared_array.hpp @@ -176,8 +176,10 @@ public: return px; } -// implicit conversion to "bool" -#include + explicit operator bool () const BOOST_SP_NOEXCEPT + { + return px != 0; + } bool unique() const BOOST_SP_NOEXCEPT { diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index bcf27aa..4f5dbb4 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -581,8 +581,10 @@ public: return px; } -// implicit conversion to "bool" -#include + explicit operator bool () const BOOST_SP_NOEXCEPT + { + return px != 0; + } bool unique() const BOOST_SP_NOEXCEPT {