This class used to get persistent reference to the object instance, whatever it is lvalue or rvalue. To ubtain such reference, use 'HoldIfTemporary' method, that has there overloads. Two of them take rvalue as a parameter, and just return the reference to it. The third one, in opposite, takes lvalue as a parameter, makes a pointer copy, then return reference to that copy. Also, class has 'Hold' method to hold passed value unconditionally (used to copy values of a local on-stack variables or it's child references)
More...
#include <holder_initializer.h>
|
| HolderInitializer (T &holder) |
| Initializes holder reference with passed one. More...
|
|
const T & | HoldIfTemporary (const T &value) |
| Returns reference to rvalue (const) More...
|
|
const T & | HoldIfTemporary (T &value) |
| Returns reference to rvalue (non-const) More...
|
|
const T & | HoldIfTemporary (T &&value) |
| Copies passed lvalue to holder, then return the holder reference. More...
|
|
const T & | Hold (const T &value) |
| Copies passed lvalue to holder, then return the holder reference Caller should use this method to hold passed value unconditionally. More...
|
|
template<typename T, bool R = System::IsSmartPtr<T>::value || std::is_same<System::String, T>::value>
struct System::HolderInitializer< T, R >
This class used to get persistent reference to the object instance, whatever it is lvalue or rvalue. To ubtain such reference, use 'HoldIfTemporary' method, that has there overloads. Two of them take rvalue as a parameter, and just return the reference to it. The third one, in opposite, takes lvalue as a parameter, makes a pointer copy, then return reference to that copy. Also, class has 'Hold' method to hold passed value unconditionally (used to copy values of a local on-stack variables or it's child references)
- Template Parameters
-
T | The type of the object to hold to. |
R | True, if T is a reference type (SmartPtr specialization or System::String type), and temporary references holding is actually required, false - otherwise. |
◆ HolderInitializer()
template<typename T , bool R = System::IsSmartPtr<T>::value || std::is_same<System::String, T>::value>
Initializes holder reference with passed one.
◆ Hold()
template<typename T , bool R = System::IsSmartPtr<T>::value || std::is_same<System::String, T>::value>
Copies passed lvalue to holder, then return the holder reference Caller should use this method to hold passed value unconditionally.
◆ HoldIfTemporary() [1/3]
template<typename T , bool R = System::IsSmartPtr<T>::value || std::is_same<System::String, T>::value>
Returns reference to rvalue (const)
◆ HoldIfTemporary() [2/3]
template<typename T , bool R = System::IsSmartPtr<T>::value || std::is_same<System::String, T>::value>
Copies passed lvalue to holder, then return the holder reference.
◆ HoldIfTemporary() [3/3]
template<typename T , bool R = System::IsSmartPtr<T>::value || std::is_same<System::String, T>::value>
Returns reference to rvalue (non-const)