Use enable_if_t instead of enable_if

This commit is contained in:
Benoit Blanchon
2024-08-27 10:00:09 +02:00
parent b4a5b053ca
commit b5bcb37657
2 changed files with 4 additions and 4 deletions

View File

@ -416,14 +416,14 @@ class VariantData {
} }
template <typename T> template <typename T>
typename enable_if<sizeof(T) == 4>::type setFloat(T value, ResourceManager*) { enable_if_t<sizeof(T) == 4> setFloat(T value, ResourceManager*) {
ARDUINOJSON_ASSERT(type_ == VALUE_IS_NULL); // must call clear() first ARDUINOJSON_ASSERT(type_ == VALUE_IS_NULL); // must call clear() first
type_ = VALUE_IS_FLOAT; type_ = VALUE_IS_FLOAT;
content_.asFloat = value; content_.asFloat = value;
} }
template <typename T> template <typename T>
typename enable_if<sizeof(T) == 8>::type setFloat(T value, ResourceManager*); enable_if_t<sizeof(T) == 8> setFloat(T value, ResourceManager*);
template <typename T> template <typename T>
enable_if_t<is_signed<T>::value> setInteger(T value, enable_if_t<is_signed<T>::value> setInteger(T value,

View File

@ -65,8 +65,8 @@ inline const VariantExtension* VariantData::getExtension(
#endif #endif
template <typename T> template <typename T>
typename enable_if<sizeof(T) == 8>::type VariantData::setFloat( enable_if_t<sizeof(T) == 8> VariantData::setFloat(T value,
T value, ResourceManager* resources) { ResourceManager* resources) {
ARDUINOJSON_ASSERT(type_ == VALUE_IS_NULL); // must call clear() first ARDUINOJSON_ASSERT(type_ == VALUE_IS_NULL); // must call clear() first
(void)resources; // silence warning (void)resources; // silence warning