*/
template <class Key, class Val>
class Cache : private QCache<Key, Val> {
*/
template <class Key, class Val>
class Cache : private QCache<Key, Val> {
static_assert(std::is_copy_constructible<Val>::value,
"lyx::Cache only stores copyable objects!");
static_assert(std::is_default_constructible<Val>::value,
"lyx::Cache only stores default-constructible objects!");
using Q = QCache<Key, Val>;
static_assert(std::is_copy_constructible<Val>::value,
"lyx::Cache only stores copyable objects!");
static_assert(std::is_default_constructible<Val>::value,
"lyx::Cache only stores default-constructible objects!");
using Q = QCache<Key, Val>;
- // Returns the default value (e.g. null pointer) before using the result. If
- // this is not convenient for your type, check if it exists beforehand with
- // Cache::contains.
+ // Returns the default value (e.g. null pointer) if not found in the
+ // cache. If this is not convenient for your class Val, check if it exists
+ // beforehand with Cache::contains.
int max_cost() const { return Q::maxCost(); }
void set_max_cost(int cost) { Q::setMaxCost(cost); }
int total_cost() const { return Q::totalCost(); }
int max_cost() const { return Q::maxCost(); }
void set_max_cost(int cost) { Q::setMaxCost(cost); }
int total_cost() const { return Q::totalCost(); }