HybridHashMap.tryGetElementFromCtorParams

Try to retrieve class-element of type Class constructed with parameters params.

Typically used to implement (polymorphic) caching of class-types without the need for GG-allocating a temporary instance of a class-element potentially already stored in this set.

Polymorphic caching can be realized by setting hasher to hash_functions.hashOfPolymorphic.

struct HybridHashMap(K, V = void, alias hasher = hashOf, string keyEqualPred = defaultKeyEqualPredOf!(K), Allocator = Mallocator, Options options = Options.init)
scope const return @trusted
static if(!hasValue)
const(Class)
tryGetElementFromCtorParams
(
Class
Params...
)
(
scope Params params
)
if (
is(Class : K)
)
if (
isAllocator!Allocator
)

Meta