#include <reference.h>
Type for a generic, non-templated strong reference binding to a StrongReference. This generic version can keep a StrongReference alive, but provides access to the instance itself only if the type is known.
◆ StrongReferenceGeneric() [1/2]
hilti::rt::StrongReferenceGeneric::StrongReferenceGeneric |
( |
| ) |
|
|
default |
Leaves the reference unbound.
◆ StrongReferenceGeneric() [2/2]
template<typename T >
hilti::rt::StrongReferenceGeneric::StrongReferenceGeneric |
( |
StrongReference< T > |
x | ) |
|
|
inline |
Binds to the same instance as an existing strong reference.
◆ as()
template<typename T >
T* hilti::rt::StrongReferenceGeneric::as |
( |
| ) |
const |
|
inline |
Obtains a pointer to the stored value.
- Returns
- a pointer to the bound instance, or null if unbound.
- Exceptions
-
IllegalReference | if the target type does not match the stored reference type. |
◆ reset()
void hilti::rt::StrongReferenceGeneric::reset |
( |
| ) |
|
|
inline |
Releases the bound reference.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/spicy-docs/checkouts/v1.6.1/hilti/runtime/include/types/reference.h