|
@@ -695,10 +695,7 @@ template <typename CharT> inline bool email(std::basic_string_view<CharT> em) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
template <typename T> inline bool ctor_as_valid(std::string_view str) {
|
|
template <typename T> inline bool ctor_as_valid(std::string_view str) {
|
|
|
- try {
|
|
|
|
|
- [[maybe_unused]] auto _ = T(str);
|
|
|
|
|
- return true;
|
|
|
|
|
- } catch (std::exception const &) { return false; }
|
|
|
|
|
|
|
+ return T::parse(str).has_value();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#if JVALIDATE_HAS_IDNA
|
|
#if JVALIDATE_HAS_IDNA
|