System::MakeSharedPtr method

System::MakeSharedPtr(const X *) method

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

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

ReturnValue

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

另见

System::MakeSharedPtr(X *) method

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

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

ReturnValue

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

另见