MakeSharedPtr()

System::MakeSharedPtr(X *) function

Converts raw pointer to smart pointer.

template<class X> SmartPtr<X> System::MakeSharedPtr(X *p)

Template parameters

ParameterDescription
XPointee type.

Arguments

ParameterTypeDescription
pX *Raw pointer to object.

Return Value

Shared smart pointer to object.

System::MakeSharedPtr(const X *) function

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)

Template parameters

ParameterDescription
XPointee type.

Arguments

ParameterTypeDescription
pconst X *Raw pointer to object.

Return Value

Shared smart pointer to object.

See Also