I am trying to create class called Stats that uses generic parameter T. I intend to use T as int? or float?. However, when I try to create object of class Stats I get that: Error 1 The type 'int?' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method .... Any help would be appreciated
Here's my code:
Stats<int?> stats = new PlayerMatchStats(); // PlayerMatchStats inherits Stats
public abstract class Stats<T> : BaseEntity where T : struct
{
}