18 bool delivered{
false};
21 constexpr LetBase()
noexcept =
default;
22 LetBase(
const LetBase& copy) =
default;
23 void reset()
noexcept { delivered =
false; }
24 [[nodiscard]]
constexpr bool has_result()
const noexcept {
return this->delivered; }
35 using block_t = std::function<T()>;
36 std::optional<T> result;
43 explicit Let(block_t body) noexcept :
LetBase(), body(body) {}
46 return std::addressof(value());
49 T& operator*() & {
return value(); }
69 return result.value();
Base class for lets to abstract away the template arguments.
Definition let.hpp:16