System::CastEnumerableTo 方法

System::CastEnumerableTo(const From&) method

对指定 enumerable 对象的元素执行显式类型转换为不同的类型。

template<class To,class From> std::enable_if<!System::detail::has_method_get_Count<From>::value, Collections::Generic::ListPtr<To>>::type System::CastEnumerableTo(const From &enumerable)
参数描述
To要将 enumerable 对象的元素静态转换到的类型
Fromenumerable 对象的类型
参数类型描述
enumerableconst From&包含待转换元素的 Enumerable 对象

ReturnValue

指向新集合的指针,该集合包含类型为 To 的元素,这些元素等价于 enumerable 的元素

另见

System::CastEnumerableTo(const From&) method

对指定 enumerable 对象的元素执行显式类型转换为不同的类型。

template<class To,class From> std::enable_if<System::detail::has_method_get_Count<From>::value, Collections::Generic::ListPtr<To>>::type System::CastEnumerableTo(const From &enumerable)
参数描述
To要将 enumerable 对象的元素静态转换到的类型
Fromenumerable 对象的类型
参数类型描述
enumerableconst From&是具有已定义 get_Count 方法的 Enumerable 对象的继承者,并包含要转换的元素

ReturnValue

指向新集合的指针,该集合包含类型为 To 的元素,这些元素等价于 enumerable 的元素

另见