Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Properties | Public Member Functions | List of all members
Loyc.Collections.UpCastListSource< T, TOut > Class Template Reference

Helper class for treating a collection of a derived type as a collection of a base type or interface. More...


Source file:
Inheritance diagram for Loyc.Collections.UpCastListSource< T, TOut >:

Remarks

Helper class for treating a collection of a derived type as a collection of a base type or interface.

LCExt.UpCast{T, TResult}(IReadOnlyCollection{T})

This class is rarely needed because generic variance allows casting IListSource{DerivedClass} to IListSource{BaseClass}. However, it is still useful to convert a list of structs from IListSource{Struct} to IListSource{IInterface}.

Type Constraints
T :TOut 

Properties

override int Count [get]
 

Public Member Functions

 UpCastListSource (IListSource< T > original)
 
override TOut TryGet (int index, out bool fail)