CastEnumerableTo()

System::CastEnumerableTo(const From&) function

Performs the explicit casting of elements of the specified enumerable object to different type.

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)

Template parameters

ParameterDescription
ToThe type to statically cast the elements of the enumerable object to
FromThe type of enumerable object

Arguments

ParameterTypeDescription
enumerableconst From&Enumerable object containing the elements to cast

Return Value

A pointer to a new collection containing elements of type To equivalent to the elements of enumerable

System::CastEnumerableTo(const From&) function

Performs the explicit casting of elements of the specified enumerable object to different type.

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)

Template parameters

ParameterDescription
ToThe type to statically cast the elements of the enumerable object to
FromThe type of enumerable object

Arguments

ParameterTypeDescription
enumerableconst From&is inheritor of Enumerable object with defined get_Count method and containing the elements to cast

Return Value

A pointer to a new collection containing elements of type To equivalent to the elements of enumerable

See Also