System::MakeSharedPtr method

System::MakeSharedPtr(X *) method

Converts raw pointer to smart pointer.

template<class X> SmartPtr<X> System::MakeSharedPtr(X *p)
ParameterDescription
XPointee type.
ParameterTypeDescription
pX *Raw pointer to object.

ReturnValue

Shared smart pointer to object.

See Also

System::MakeSharedPtr(const X *) method

Converts raw pointer to smart pointer. Overload for const pointers. Useful e. g. when using ’this’ variable in C# methods translated as const.

template<class X> SmartPtr<X> System::MakeSharedPtr(const X *p)
ParameterDescription
XPointee type.
ParameterTypeDescription
pconst X *Raw pointer to object.

ReturnValue

Shared smart pointer to object.

See Also