Utility wrappers and containers¶
-
class unique_any¶
A container for a single value of any type that is move constructable. Used in the Arbor API where a type of a value passed to or from the API is decided at run time.
-
class any_ptr¶
Holds a pointer to an arbitrary type, together with the type information.
-
template<typename T>
T as()¶ Retrieve the pointer as type T. If T is
void *
or the same as the type of the pointer stored inany_ptr
, return the held value, cast accordingly. Otherwise returnnullptr
.
any_ptr
can be used withutil::any_cast
, so thatutil::any_cast<T>(p)
is equivalent top.as<T>()
for a valuep
of typeany_ptr
.-
template<typename T>
-
template<typename T>
any_cast(...)¶ Equivalent to
std::any_cast
forstd::any
arguments,any_cast
also performs analogous casting for theunique_any
andany_ptr
utility classes.See Cable cells.