Manually implement explicit boolean conversion, removing header dependency on Core's polyfill

This commit is contained in:
Christian Mazakas
2023-09-29 08:03:49 -07:00
parent 0d61746fa3
commit 4fcc6a9cab
2 changed files with 8 additions and 4 deletions

View File

@ -18,7 +18,6 @@
#include <boost/unordered/detail/serialize_fca_container.hpp>
#include <boost/unordered/detail/type_traits.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/container_hash/hash.hpp>
#include <initializer_list>
@ -2253,7 +2252,10 @@ namespace boost {
allocator_type get_allocator() const { return *alloc_; }
BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
BOOST_FORCEINLINE explicit operator bool() const noexcept
{
return !this->operator!();
}
bool operator!() const noexcept { return ptr_ ? 0 : 1; }

View File

@ -18,7 +18,6 @@
#include <boost/unordered/detail/set.hpp>
#include <boost/unordered/detail/type_traits.hpp>
#include <boost/core/explicit_operator_bool.hpp>
#include <boost/container_hash/hash.hpp>
#include <initializer_list>
@ -1876,7 +1875,10 @@ namespace boost {
allocator_type get_allocator() const { return *alloc_; }
BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
BOOST_FORCEINLINE explicit operator bool() const noexcept
{
return !this->operator!();
}
bool operator!() const noexcept { return ptr_ ? 0 : 1; }