density
C++11 library for paged memory management, function queues, heterogeneous queues and lifo memory management
|
#include <dynamic_reference.h>
Public Member Functions | |
dynamic_reference ()=delete | |
template<typename TARGET_TYPE > | |
dynamic_reference (TARGET_TYPE &i_target_object) | |
constexpr | dynamic_reference (const RUNTIME_TYPE &i_target_type, add_cv_qual_t< void, CV_QUALIFIER > *i_target_address) |
template<cv_qual OTHER_CV> | |
constexpr | dynamic_reference (const dynamic_reference< RUNTIME_TYPE, OTHER_CV > &i_source) |
dynamic_reference & | operator= (const dynamic_reference &i_source)=delete |
constexpr const RUNTIME_TYPE & | type () const noexcept |
constexpr add_cv_qual_t< void, CV_QUALIFIER > * | address () const noexcept |
template<typename TYPE > | |
constexpr bool | is () const noexcept |
template<typename TYPE > | |
DENSITY_CPP14_CONSTEXPR add_cv_qual_t< TYPE, CV_QUALIFIER > & | as () const noexcept |
Holds a reference to an object whose type in unknown at compile time. This class template is an abstraction of a pair of void pointer and a runtime type.
RUNTIME_TYPE | Runtime-type object used to store the actual complete type of the target object. This type must satisfy the requirements of RuntimeType. The default is runtime_type. |
CV_QUALIFIER | CV-qualification of the reference. The default is cv_qual::no_qual. |
The convenience alias templates const_dynamic_reference, volatile_dynamic_reference and const_volatile_dynamic_reference constraint the cv_qual template parameter respectively to cv_qual::const_qual, cv_qual::volatile_qual and cv_qual::const_volatile_qual.
|
delete |
Deleted default constructor.
|
inline |
Constructs an instance of dynamic_reference bound to the specified target object.
This constructor is excluded from the overload set if the type of the target type is more cv-qualified than this specialization of dynamic_reference:
Postcoditions: Given an object t, the following conditions hold:
Throws: unspecified
|
inline |
Constructs a dynamic_reference assigning a target object.
Postcoditions: Given an object t, the following conditions hold:
Throws: unspecified
|
inline |
Generalized copy constructor.
This constructor is excluded from the overload set if the argument is more cv-qualified than this dynamic_reference specialization:
Postcoditions: Given an object r of a specialization of dynamic_reference, the following conditions hold:
Throws: unspecified
|
delete |
Deleted copy assignment.
|
inlinenoexcept |
Returns a reference to the runtime type.
Throws: nothing
|
inlinenoexcept |
Returns the address of the target object. If the dynamic_reference is empty, the return value is nullptr.
Throws: nothing
|
inlinenoexcept |
Returns whether the target type is bound to the provided compile-time type and TYPE is not less cv-qualified than this specialization of dynamic_reference.
Example:
Throws: nothing
|
inlinenoexcept |
Returns a reference to the target object, assuming that the target type is bound to the provided compile-time type.
Precoditions: The behavior is undefined if any of these conditions is not satisfied:
Example:
Throws: nothing