File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,6 @@ class EXIV2API Xmpdatum : public Metadatum {
5656 Calls setValue(const std::string&).
5757 */
5858 Xmpdatum& operator =(const std::string& value);
59- /* !
60- @brief Assign a boolean \em value to the %Xmpdatum.
61- Translates the value to a string "true" or "false".
62- */
63- inline Xmpdatum& operator =(bool value);
6459 /* !
6560 @brief Assign a \em value of any type with an output operator
6661 to the %Xmpdatum. Calls operator=(const std::string&).
@@ -398,14 +393,19 @@ class EXIV2API XmpParser {
398393// *****************************************************************************
399394// free functions, template and inline definitions
400395
401- Xmpdatum& Xmpdatum::operator =(bool value) {
402- return operator =(value ? " True" : " False" );
403- }
404-
405396template <typename T>
406397Xmpdatum& Xmpdatum::operator =(const T& value) {
407- setValue (Exiv2::toString (value));
408- return *this ;
398+ #ifdef __cpp_if_constexpr
399+ if constexpr (std::is_same_v<T, bool >) {
400+ #else
401+ if (std::is_same<T, bool >::value) {
402+ #endif
403+ setValue (Exiv2::toString (value ? " True" : " False" ));
404+ return *this ;
405+ } else {
406+ setValue (Exiv2::toString (value));
407+ return *this ;
408+ }
409409}
410410
411411} // namespace Exiv2
You can’t perform that action at this time.
0 commit comments