CBMC
lazyt< valuet > Class Template Reference

#include <lazy.h>

Public Member Functions

valuet force ()
 Force the computation of the value. More...
 

Static Public Member Functions

static lazyt from_fun (std::function< valuet()> fun)
 Delay the computation of fun to the next time the force method is called. More...
 

Private Member Functions

 lazyt (std::function< valuet()> fun)
 

Private Attributes

std::optional< valuet > value
 
std::function< valuet()> evaluation_function
 

Detailed Description

template<typename valuet>
class lazyt< valuet >

Definition at line 16 of file lazy.h.

Constructor & Destructor Documentation

◆ lazyt()

template<typename valuet >
lazyt< valuet >::lazyt ( std::function< valuet()>  fun)
inlineexplicitprivate

Definition at line 40 of file lazy.h.

Member Function Documentation

◆ force()

template<typename valuet >
valuet lazyt< valuet >::force ( )
inline

Force the computation of the value.

If it was already computed, return the same result.

Definition at line 28 of file lazy.h.

◆ from_fun()

template<typename valuet >
static lazyt lazyt< valuet >::from_fun ( std::function< valuet()>  fun)
inlinestatic

Delay the computation of fun to the next time the force method is called.

Definition at line 21 of file lazy.h.

Member Data Documentation

◆ evaluation_function

template<typename valuet >
std::function<valuet()> lazyt< valuet >::evaluation_function
private

Definition at line 38 of file lazy.h.

◆ value

template<typename valuet >
std::optional<valuet> lazyt< valuet >::value
private

Definition at line 37 of file lazy.h.


The documentation for this class was generated from the following file: