This is probably not possible, but I have this class:
public class Metadata<DataType> where DataType : struct { private DataType mDataType; }
There’s more to it, but let’s keep it simple. The generic type (DataType) is limited to value types by the where statement. What I want to do is have a list of these Metadata objects of varying types (DataType). Such as:
List<Metadata> metadataObjects; metadataObjects.Add(new Metadata<int>()); metadataObjects.Add(new Metadata<bool>()); metadataObjects.Add(new Metadata<double>());
Is this even possible?
1 Answer