Skip to content

Commit 5ccb525

Browse files
committed
remove inline function
Just make it part of the template Signed-off-by: Rosen Penev <[email protected]>
1 parent 763cfaf commit 5ccb525

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

include/exiv2/xmp_exiv2.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff 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-
405396
template <typename T>
406397
Xmpdatum& 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

0 commit comments

Comments
 (0)