From ef6830e01c851f57ba024da37d715fbb7ad492da Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Thu, 16 Nov 2023 00:34:03 +0100 Subject: [PATCH] Added operator-> to optional type. --- source/mijin/container/optional.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/mijin/container/optional.hpp b/source/mijin/container/optional.hpp index 54ae8ed..57b2ac4 100644 --- a/source/mijin/container/optional.hpp +++ b/source/mijin/container/optional.hpp @@ -142,6 +142,10 @@ public: constexpr std::remove_reference_t& operator*() noexcept { return get(); } [[nodiscard]] constexpr const std::remove_reference_t& operator*() const noexcept { return get(); } + [[nodiscard]] + constexpr std::remove_reference_t* operator->() noexcept { return &get(); } + [[nodiscard]] + constexpr const std::remove_reference_t* operator->() const noexcept { return &get(); } public: template void emplace(Types&&... params) noexcept;