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<typenameT,bool>classHolderInitializer
Template parameters
Parameter
Description
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.