4#ifndef DASMIG_CORE_COUNTRY_HPP
5#define DASMIG_CORE_COUNTRY_HPP
26[[nodiscard]]
constexpr bool is_alpha2(std::string_view code)
noexcept
28 return code.size() == 2 && code[0] >=
'A' && code[0] <=
'Z' && code[1] >=
'A' && code[1] <=
'Z';
42 return std::invalid_argument{std::string{
"Unknown country code: "}.append(code)};
constexpr bool is_alpha2(std::string_view code) noexcept
Whether text has the shape of an ISO 3166-1 alpha-2 code: exactly two capital ASCII letters.
std::invalid_argument unknown_country_error(std::string_view code)
The exception libraries throw for a country code they have no data for. Its message is Unknown countr...