Use more explicit operator= override

Signed-off-by: Nicholas Van Sickle <nvsickle@amazon.com>
This commit is contained in:
Nicholas Van Sickle
2022-01-06 16:54:57 -08:00
parent e7f573d22a
commit 25924c3d38
+5 -3
View File
@@ -225,10 +225,12 @@ namespace AZ::Dom
Value& operator=(const Value&);
Value& operator=(Value&&) noexcept;
template <class T>
Value& operator=(T value)
//! Assignment operator to allow forwarding types constructible via Value(T) to be assigned
template<class T>
auto operator=(T&& arg)
-> AZStd::enable_if_t<!AZStd::is_same_v<AZStd::remove_cvref_t<T>, Value> && AZStd::is_constructible_v<Value, T>, Value&>
{
return operator=(Value(value));
return operator=(Value(AZStd::forward<T>(arg)));
}
bool operator==(const Value& rhs) const;