xieite::isgraph()

Defined in header <xieite/data/isgraph.hpp>

An improved replacement and extension of std::isgraph().


Declarations

#0
[[nodiscard]] constexpr bool isgraph(xieite::is_char auto c) noexcept;
Checks if a single character has a graphical representation.

#1
template<xieite::is_char Char, typename Traits>
[[nodiscard]] constexpr bool isgraph(std::basic_string_view<Char, Traits> strv) noexcept;
Checks if a string consists only of graphical characters.

#2
template<xieite::is_char Char, typename Traits, typename Alloc>
[[nodiscard]] constexpr bool isgraph(const std::basic_string_view<Char, Traits, Alloc>& str) noexcept;
Defers to #1 after deducing Char.

#2
template<xieite::is_char Char, std::size_t length>
[[nodiscard]] constexpr bool isgraph(const xieite::paren<Char[length]>& str) noexcept;
Defers to #1 after deducing Char.


Example

static_assert(xieite::isgraph('a'));
static_assert(xieite::isgraph('0'));
static_assert(xieite::isgraph('!'));
static_assert(not xieite::isgraph(' '));
[View in Compiler Explorer]