Empirical
|
#include <memo_function.h>
Public Types | |
using | size_t = std::size_t |
using | return_t = R |
using | index_t = std::decay_t< ARG > |
using | fun_t = std::function< R(ARG)> |
using | this_t = memo_function< R(ARG)> |
Public Member Functions | |
template<typename T > | |
memo_function (T &&fun_info) | |
memo_function (const this_t &)=default | |
memo_function (this_t &&)=default | |
memo_function () | |
this_t & | operator= (const this_t &)=default |
Copy another memo_function of the same type. More... | |
this_t & | operator= (this_t &&)=default |
Move to here another memo function of the same type. More... | |
this_t & | operator= (const fun_t &_f) |
Set a new std::function of the appropriate type. More... | |
this_t & | operator= (fun_t &&_f) |
Move to here an std::function of the appropriate type. More... | |
template<typename T > | |
this_t & | operator= (T &&arg) |
A universal copy/move for other combinations that work with std::function. More... | |
size_t | size () const |
How many values have been cached? More... | |
bool | Has (const ARG &k) const |
Test if a certain input has been cached. More... | |
void | Clear () |
Clear out the cache. More... | |
void | Erase (const ARG &k) |
Erase a specific entry from the cache. More... | |
template<class KEY > | |
return_t | operator() (KEY &&k) const |
Call the memo_function. More... | |
operator bool () const | |
Identify if the memo_function has been set. More... | |
operator std::function<R (ARG)>() | |
Convert a memo_function to a regular std::function for function calls. More... | |
std::function< R(ARG)> | to_function () |
Convert a memo_function to a regular std::function for function calls. More... | |
using emp::memo_function< R(ARG)>::fun_t = std::function<R(ARG)> |
using emp::memo_function< R(ARG)>::index_t = std::decay_t<ARG> |
using emp::memo_function< R(ARG)>::return_t = R |
using emp::memo_function< R(ARG)>::size_t = std::size_t |
using emp::memo_function< R(ARG)>::this_t = memo_function<R(ARG)> |
|
inline |
|
default |
|
default |
|
inline |
|
inline |
Clear out the cache.
|
inline |
Erase a specific entry from the cache.
|
inline |
Test if a certain input has been cached.
|
inline |
Identify if the memo_function has been set.
|
inline |
Convert a memo_function to a regular std::function for function calls.
|
inline |
Call the memo_function.
|
default |
Copy another memo_function of the same type.
|
default |
Move to here another memo function of the same type.
|
inline |
Set a new std::function of the appropriate type.
|
inline |
Move to here an std::function of the appropriate type.
|
inline |
A universal copy/move for other combinations that work with std::function.
|
inline |
How many values have been cached?
|
inline |
Convert a memo_function to a regular std::function for function calls.