|
SpECTRE
v2026.04.01
|
A cache of objects intended to be stored in a static variable. More...
#include <StaticCache.hpp>
Public Member Functions | |
| template<typename Gen> | |
| StaticCache (Gen &&generator) | |
| template<typename... Args> | |
| const T & | operator() (const Args... parameters) const |
A cache of objects intended to be stored in a static variable.
Objects can be accessed via a combination of several size_t and enum arguments. The range of each integral argument is specified via a template parameter of type CacheRange<start, end>, giving the first and one-past-last values for the range. Each enum argument is specified by a template parameter of type CacheEnumeration<EnumerationType, Members...> giving the enumeration type and an explicit set of every enum member to be cached.
A cache with only numeric indices:
A cache with enumeration indices:
A cache with mixed numeric and enumeration indices:
A cache with no arguments at all (caching only a single object)
| T | type held in the cache |
| Ranges | ranges of valid indices |