xieite ::isprint ()
Defined in header <xieite/data/isprint.hpp>
An improved replacement and extension of
std ::isprint ()
.Declarations
#0Checks if a single character has a graphical representation or is a space.[[nodiscard ]]constexpr bool isprint (xieite ::is_char auto c )noexcept ;
#1
Checks if a string consists only of printable characters.template <xieite ::is_char Char ,typename Traits > [[nodiscard ]]constexpr bool isprint (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 isprint (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 isprint (const xieite ::paren <Char [length ]>& str )noexcept ;
Char
.Example
[View in Compiler Explorer]static_assert (xieite ::isprint ('a' ));static_assert (xieite ::isprint ('0' ));static_assert (xieite ::isprint ('!' ));static_assert (xieite ::isprint (' ' ));static_assert (not xieite ::isprint ('\n' ));