System::MakeSharedPtr 方法

System::MakeSharedPtr(const X *) method

将原始指针转换为智能指针。针对 const 指针的重载。当在 C# 方法中使用 ’this’ 变量并在 C++ 中被翻译为 const 时非常有用。

template<class X> SmartPtr<X> System::MakeSharedPtr(const X *p)
Parameter描述
X指向的类型。
ParameterType描述
pconst X *指向对象的原始指针。

ReturnValue

指向对象的共享智能指针。

另见

System::MakeSharedPtr(X *) method

将原始指针转换为智能指针。

template<class X> SmartPtr<X> System::MakeSharedPtr(X *p)
Parameter描述
X指向的类型。
ParameterType描述
pX *指向对象的原始指针。

ReturnValue

指向对象的共享智能指针。

另见