xieite::isalpha()

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

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


Declarations

#0
[[nodiscard]] constexpr bool isalpha(xieite::is_char auto c) noexcept;
Checks if a single character is alphabetic.

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

#2
template<xieite::is_char Char, typename Traits, typename Alloc>
[[nodiscard]] constexpr bool isalpha(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 isalpha(const xieite::paren<Char[length]>& str) noexcept;
Defers to #1 after deducing Char.


Example

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