Home | Libraries | People | FAQ | More |
namespace util { template <class C> struct is_whitespace; }
This is a lazy template metafunction that supports currying.
Checks if C
is a whitespace
character. Returns a boxed boolean value.
#include <boost/metaparse/util/is_whitespace.hpp>
For any C
nullary template
metafunction returning a wrapped character value the following are equivalent:
is_whitespace<C>::type is_whitespace<>::type::apply<C>::type is_whitespace_c<C::type::value>::type
#include <boost/metaparse/util/is_whitespace.hpp> #include <type_traits> using namespace boost::metaparse; struct returns_char { using type = std::integral_constant<char, ' '>; }; static_assert( util::is_whitespace<std::integral_constant<char, ' '>>::type::value, "a space should be a whitespace character" ); static_assert( !util::is_whitespace<std::integral_constant<char, '0'>>::type::value, "a number should not be a whitespace character" ); static_assert( util::is_whitespace<>::type ::apply<std::integral_constant<char, '\t'>>::type::value, "it should support currying" ); static_assert( util::is_whitespace<returns_char>::type::value, "it should support lazy evaluation" );