diff --git a/include/rfl/Validator.hpp b/include/rfl/Validator.hpp index 1e02a9c6..e7813276 100644 --- a/include/rfl/Validator.hpp +++ b/include/rfl/Validator.hpp @@ -30,6 +30,10 @@ struct Validator { Validator() : value_(V::validate(T()).value()) {} + Validator(Validator&& _other) noexcept = default; + + Validator(const Validator& _other) = default; + Validator(const T& _value) : value_(V::validate(_value).value()) {} template , @@ -44,6 +48,18 @@ struct Validator { return *this; } + /// Assigns the underlying object. + auto& operator=(T&& _value) { + value_ = V::validate(_value).value(); + return *this; + } + + /// Assigns the underlying object. + Validator& operator=(const Validator& _other) = default; + + /// Assigns the underlying object. + Validator& operator=(Validator&& _other) = default; + /// Assigns the underlying object. template , bool>::type = true>