xieite ::isspace ()
Defined in header <xieite/data/isspace.hpp>
An improved replacement and extension of
std ::isspace ()
.Declarations
#0Checks if a single character is a space, horizontal tab, vertical tab, newline, carriage return, or form feed.[[nodiscard ]]constexpr bool isspace (xieite ::is_char auto c )noexcept ;
#1
Checks if a string consists only of whitespace characters.template <xieite ::is_char Char ,typename Traits > [[nodiscard ]]constexpr bool isspace (std ::basic_string_view <Char ,Traits >strv )noexcept ;
#2
Defers to #1 after deducingtemplate <xieite ::is_char Char ,typename Traits ,typename Alloc > [[nodiscard ]]constexpr bool isspace (const std ::basic_string_view <Char ,Traits ,Alloc >& str )noexcept ;
Char
.#2
Defers to #1 after deducingtemplate <xieite ::is_char Char ,std ::size_t length > [[nodiscard ]]constexpr bool isspace (const xieite ::paren <Char [length ]>& str )noexcept ;
Char
.Example
[View in Compiler Explorer]static_assert (xieite ::isspace (' ' ));static_assert (xieite ::isspace ('\n' ));static_assert (not xieite ::isspace ('a' ));