We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is_bool.hpp
// Distributed under the Boost Software License Version 1.0 https://www.boost.org/LICENSE_1_0.txt // Copyright Gero Peterhoff #ifndef BOOST_TYPE_TRAITS_IS_BOOL_HPP #define BOOST_TYPE_TRAITS_IS_BOOL_HPP #include <boost/type_traits/remove_cvref.hpp> #include <boost/type_traits/is_same.hpp> namespace boost { template <typename Type> struct is_bool : public integral_constant < bool, is_same<typename remove_cvref<Type>::type, bool>::value > {}; #if !defined(BOOST_NO_CXX17_INLINE_VARIABLES) template <typename Type> inline constexpr bool is_bool_v = is_bool<Type>::value; #endif } // boost #endif // BOOST_TYPE_TRAITS_IS_BOOL_HPP
The text was updated successfully, but these errors were encountered:
Clearly we can add this, but in the many years of type_traits existence, no one has ever asked for it, looks a bit too trivial to me.
Sorry, something went wrong.
It is therefore high time to make this available. I don't even want to know how many people have already programmed around it ...
The only use I can give for this (somewhat trivial) trait is that in Endian, a lot of the functions take "an integral type that is not bool".
It only saves one remove_cv in comparison to is_same<T, bool>, but so does is_void.
remove_cv
is_same<T, bool>
is_void
No branches or pull requests
is_bool.hpp
The text was updated successfully, but these errors were encountered: