Allow any old and crufty protocol version
[ghsmtp.git] / is_ascii.hpp
blob21e3cb5f5d1d9ba9282617f8cb733605b43056b4
1 #include <algorithm>
2 #include <string_view>
4 constexpr bool isascii(auto c) noexcept
6 return (static_cast<unsigned char>(c) & 0x80) == 0;
9 constexpr bool is_ascii(std::string_view str) noexcept
11 return !std::any_of(std::begin(str), std::end(str),
12 [](auto ch) { return !isascii(ch); });