Use *_t and *_v trait helpers from C++17 STL (#731)

This commit is contained in:
Bart Louwers
2023-01-26 10:10:33 +00:00
committed by GitHub
parent e94f0e9b1b
commit f7fa009f08
24 changed files with 58 additions and 59 deletions

View File

@@ -33,7 +33,7 @@ optional<std::string> Converter<std::string>::operator()(const Convertible& valu
}
template <class T>
optional<T> Converter<T, typename std::enable_if_t<std::is_enum<T>::value>>::operator()(const Convertible& value, Error& error) const {
optional<T> Converter<T, typename std::enable_if_t<std::is_enum_v<T>>>::operator()(const Convertible& value, Error& error) const {
optional<std::string> string = toString(value);
if (!string) {
error.message = "value must be a string";
@@ -50,7 +50,7 @@ optional<T> Converter<T, typename std::enable_if_t<std::is_enum<T>::value>>::ope
}
template <class T>
auto Converter<std::vector<T>, typename std::enable_if_t<std::is_enum<T>::value>>::operator()(const Convertible& value, Error& error) const -> optional<std::vector<T>> {
auto Converter<std::vector<T>, typename std::enable_if_t<std::is_enum_v<T>>>::operator()(const Convertible& value, Error& error) const -> optional<std::vector<T>> {
if (!isArray(value)) {
error.message = "value must be an array";
return nullopt;