Added operator->() and made get() and operator*() const.
This commit is contained in:
parent
b40814e58b
commit
543d77859d
@ -80,9 +80,10 @@ public:
|
|||||||
Property(Property&&) noexcept = default;
|
Property(Property&&) noexcept = default;
|
||||||
|
|
||||||
Property& operator=(Property&&) noexcept = default;
|
Property& operator=(Property&&) noexcept = default;
|
||||||
PropertyProxy operator*() noexcept { return PropertyProxy(this); }
|
PropertyProxy operator*() const noexcept { return PropertyProxy(this); }
|
||||||
|
std::remove_reference_t<TGet>* operator->() const noexcept { return &get(); }
|
||||||
|
|
||||||
[[nodiscard]] TGet get() noexcept
|
[[nodiscard]] TGet get() const noexcept
|
||||||
{
|
{
|
||||||
MIJIN_ASSERT_FATAL(storage_ != nullptr, "Cannot get value from an unset property.");
|
MIJIN_ASSERT_FATAL(storage_ != nullptr, "Cannot get value from an unset property.");
|
||||||
return storage_->getValue();
|
return storage_->getValue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user