remove inline function
Just make it part of the template Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
763cfaf2b4
commit
5ccb525dd3
@ -56,11 +56,6 @@ class EXIV2API Xmpdatum : public Metadatum {
|
|||||||
Calls setValue(const std::string&).
|
Calls setValue(const std::string&).
|
||||||
*/
|
*/
|
||||||
Xmpdatum& operator=(const std::string& value);
|
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
|
@brief Assign a \em value of any type with an output operator
|
||||||
to the %Xmpdatum. Calls operator=(const std::string&).
|
to the %Xmpdatum. Calls operator=(const std::string&).
|
||||||
@ -398,14 +393,19 @@ class EXIV2API XmpParser {
|
|||||||
// *****************************************************************************
|
// *****************************************************************************
|
||||||
// free functions, template and inline definitions
|
// free functions, template and inline definitions
|
||||||
|
|
||||||
Xmpdatum& Xmpdatum::operator=(bool value) {
|
|
||||||
return operator=(value ? "True" : "False");
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
Xmpdatum& Xmpdatum::operator=(const T& value) {
|
Xmpdatum& Xmpdatum::operator=(const T& value) {
|
||||||
setValue(Exiv2::toString(value));
|
#ifdef __cpp_if_constexpr
|
||||||
return *this;
|
if constexpr (std::is_same_v<T, bool>) {
|
||||||
|
#else
|
||||||
|
if (std::is_same<T, bool>::value) {
|
||||||
|
#endif
|
||||||
|
setValue(Exiv2::toString(value ? "True" : "False"));
|
||||||
|
return *this;
|
||||||
|
} else {
|
||||||
|
setValue(Exiv2::toString(value));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Exiv2
|
} // namespace Exiv2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user