System::StaticCastArray 方法

System::StaticCastArray(const System::SharedPtr<System::Array<From>>&) method

执行对指定数组元素的类型转换。针对 From 为 SmartPtr 对象的情况进行重写。

template<typename To,typename From> std::enable_if_t<System::IsSmartPtr<From>::value, System::SharedPtr<System::Array<To>>> System::StaticCastArray(const System::SharedPtr<System::Array<From>> &from)
Parameter描述
要将指定数组的元素转换成的类型
From要进行转换的数组元素的类型
ParameterType描述
起始const System::SharedPtr<System::Array<From>>&指向包含待转换元素的数组的共享指针

ReturnValue

指向新数组的指针,该数组包含与 from 元素等价的 To 类型元素

Deprecated

为向后兼容而添加。请改用 ExplicitCast。

另见

System::StaticCastArray(const System::SharedPtr<System::Array<From>>&) method

执行对指定数组元素的类型转换。针对 From 为 Boxable 且 To 为 Object 的情况进行重写。

template<typename To,typename From> std::enable_if_t<!System::IsSmartPtr<From>::value &&System::IsBoxable<From>::value &&std::is_same<To, System::SharedPtr<Object>>::value, System::SharedPtr<System::Array<To>>> System::StaticCastArray(const System::SharedPtr<System::Array<From>> &from)
Parameter描述
要将指定数组的元素转换成的类型
From要进行转换的数组元素的类型
ParameterType描述
起始const System::SharedPtr<System::Array<From>>&指向包含待转换元素的数组的共享指针

ReturnValue

指向新数组的指针,该数组包含与 from 元素等价的 To 类型元素

Deprecated

为向后兼容而添加。请改用 ExplicitCast。

另见