Skip to content

Commit

Permalink
fix: fix optional_ref at c++20
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Jun 20, 2024
1 parent 46ac97c commit 8ea7b15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mc/common/wrapper/optional_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ class optional_ref {
[[nodiscard]] constexpr decltype(auto) rbegin() const { return (get().rbegin()); }
[[nodiscard]] constexpr decltype(auto) crend() const { return (get().crend()); }
[[nodiscard]] constexpr decltype(auto) crbegin() const { return (get().crbegin()); }

#if _HAS_CXX23
template <class Fn>
constexpr auto and_then(Fn&& fn) const {
using Ret = std::invoke_result_t<Fn, T&>;
Expand Down Expand Up @@ -153,6 +155,7 @@ class optional_ref {
return std::invoke(std::forward<Fn>(fn));
}
}
#endif // _HAS_CXX23
};
// NOLINTEND
template <typename T>
Expand Down

0 comments on commit 8ea7b15

Please sign in to comment.