diff --git a/misc/traits.h b/misc/traits.h index 20a630c..f1aac92 100644 --- a/misc/traits.h +++ b/misc/traits.h @@ -131,6 +131,9 @@ CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK(IsReservable, std::declval().reserve /// \brief Evaluates to Bool if the specified type can has a resize() method; otherwise evaluates to Bool. CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK(IsResizable, std::declval().resize(0u)); +/// \brief Evaluates to Bool if the specified type has operator bool(); otherwise evaluates to Bool. +CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK(HasOperatorBool, std::declval() ? true : false); + /// \brief Evaluates to Bool if the specified type is iteratable (can be used in for-each loop); otherwise evaluates to Bool. CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK(IsIteratable, // begin/end and operator !=