9 #ifndef CPROVER_UTIL_LAZY_H
10 #define CPROVER_UTIL_LAZY_H
15 template <
typename valuet>
23 return lazyt{std::move(fun)};
40 explicit lazyt(std::function<valuet()> fun)
48 template <
typename funt>
51 return lazyt<decltype(fun())>::from_fun(std::move(fun));
std::optional< valuet > value
static lazyt from_fun(std::function< valuet()> fun)
Delay the computation of fun to the next time the force method is called.
std::function< valuet()> evaluation_function
valuet force()
Force the computation of the value.
lazyt(std::function< valuet()> fun)
auto lazy(funt fun) -> lazyt< decltype(fun())>
Delay the computation of fun to the next time the force method is called.