Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Public Types | Public Member Functions | Private Member Functions | Private Attributes
mty::Cache< T, U > Class Template Reference

Public Types

using CachedData = std::pair< T, U >
 
using Comparator = std::function< bool(T const &, T const &)>
 
using Releaser = std::function< U(U const &)>
 

Public Member Functions

 Cache (Comparator &&t_comparator=[](T const &a, T const &b) { return a==b;}, Releaser &&t_releaser=[](U const &res) { return res;})
 
template<class Calculator >
calculate (T const &input, Calculator &&calc)
 
auto find (T const &key)
 
auto find (T const &key) const
 

Private Member Functions

U const & add (T const &key, U const &value)
 

Private Attributes

std::vector< CachedData > cached
 
Comparator comparator
 
Releaser releaser
 

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