diff --git a/include/rfl/Flatten.hpp b/include/rfl/Flatten.hpp index 62beb18b..04ea6f38 100644 --- a/include/rfl/Flatten.hpp +++ b/include/rfl/Flatten.hpp @@ -15,6 +15,8 @@ struct Flatten { /// The underlying type. using Type = std::remove_cvref_t; + Flatten() = default; + Flatten(const Type& _value) : value_(_value) {} Flatten(Type&& _value) noexcept : value_(std::forward(_value)) {} @@ -91,6 +93,18 @@ struct Flatten { return *this; } + /// Three-way comparison operator + template + auto operator<=>(const Flatten& _f) const { + return value_ <=> _f.value_; + } + + /// Equality comparison operator. + template + bool operator==(const Flatten& _f) const { + return value_ == _f.get(); + } + /// Assigns the underlying object. void set(const Type& _value) { value_ = _value; }