|
template<class K , class V > |
bool | contains (Any_Key< K, V > key) const |
|
template<class K , class V > |
auto & | operator[] (Any_Key< K, V > key) |
|
template<class K , class V > |
auto & | at (Any_Key< K, V > key) |
|
template<class K , class V , class... DefaultArgs> |
auto & | get (Any_Key< K, V > key, DefaultArgs &&... args) |
|
template<class K , class V > |
auto & | get (Any_Key< K, V > key, V &&value) |
|
template<class K , class V , class... Args> |
auto | emplace (Any_Key< K, V > key, Args &&... args) |
|
int | empty () const |
|
int | size () const |
|
int | max_size () const |
|
auto | begin () const |
|
auto | end () const |
|
auto | begin () |
|
auto | end () |
|
auto | cbegin () |
|
auto | cend () |
|
Any_Map stores a buck of std::shared_ptr<void>.
Elements are retrieved through:
myMap[Any_Key<K, V>()]
It is recommended to use "Name" with Any_Key to emulate constexpr-strings
myMap[Any_Key<Name<'K','E','Y'>, ValueType>]
Once CUDA supporst C++17 (which supports constexpr strings as template args) we will switch Any_Key to simply being a <String, ValueType>.
The operator[] is a template argument, which enables casting to the correct type without any dynamic checks. This results in efficient access to 'any' type within a pseudo-heterogeneous container.