diff --git a/include/exiv2/xmp_exiv2.hpp b/include/exiv2/xmp_exiv2.hpp index 47cf16c6..94002a86 100644 --- a/include/exiv2/xmp_exiv2.hpp +++ b/include/exiv2/xmp_exiv2.hpp @@ -56,11 +56,6 @@ class EXIV2API Xmpdatum : public Metadatum { Calls setValue(const std::string&). */ Xmpdatum& operator=(const std::string& value); - /*! - @brief Assign a boolean \em value to the %Xmpdatum. - Translates the value to a string "true" or "false". - */ - inline Xmpdatum& operator=(bool value); /*! @brief Assign a \em value of any type with an output operator to the %Xmpdatum. Calls operator=(const std::string&). @@ -398,14 +393,19 @@ class EXIV2API XmpParser { // ***************************************************************************** // free functions, template and inline definitions -Xmpdatum& Xmpdatum::operator=(bool value) { - return operator=(value ? "True" : "False"); -} - template Xmpdatum& Xmpdatum::operator=(const T& value) { - setValue(Exiv2::toString(value)); - return *this; +#ifdef __cpp_if_constexpr + if constexpr (std::is_same_v) { +#else + if (std::is_same::value) { +#endif + setValue(Exiv2::toString(value ? "True" : "False")); + return *this; + } else { + setValue(Exiv2::toString(value)); + return *this; + } } } // namespace Exiv2