MCPcopy Create free account
hub / github.com/ThePhD/sol2 / or_else

Method or_else

include/sol/optional_implementation.hpp:891–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889 /// \synopsis template <class F> optional<T> or_else (F &&f) &&;
890 template <class F, detail::enable_if_ret_void<F>* = nullptr>
891 optional<T> or_else(F&& f) && {
892 if (has_value())
893 return std::move(*this);
894
895 std::forward<F>(f)();
896 return nullopt;
897 }
898
899 /// \exclude
900 template <class F, detail::disable_if_ret_void<F>* = nullptr>

Callers

nothing calls this directly

Calls 1

has_valueFunction · 0.85

Tested by

no test coverage detected