From 1a28d9d60fd470c111134414c1921e43a8bb26ab Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 12 Jun 2025 18:33:25 +0300 Subject: [PATCH] Mark bitmask_set generated by BOOST_BITMASK as deprecated. This function is not really needed and can be replaced with double negation (!!) or comparison with an enum value of zero. We should prefer to minimize polluting the user's namespace with new names. --- include/boost/detail/bitmask.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/detail/bitmask.hpp b/include/boost/detail/bitmask.hpp index 4410321..7ad4c97 100644 --- a/include/boost/detail/bitmask.hpp +++ b/include/boost/detail/bitmask.hpp @@ -83,6 +83,7 @@ using underlying_type_t = typename std::underlying_type< Enum >::type; inline BOOST_CONSTEXPR bool operator!(Bitmask x) BOOST_NOEXCEPT \ { return !static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(x); } \ \ + BOOST_DEPRECATED("bitmask_set(enum) is deprecated, use !!enum or comparison operators instead") \ inline BOOST_CONSTEXPR bool bitmask_set(Bitmask x) BOOST_NOEXCEPT \ { return !!x; }