Relative Content

Tag Archive for c#genericsabstraction

Generic types in abstract classes

I am looking for a C# solution that allows me to create a base class (AParam) whose inherited classes (Param) can be generic in order to implement different, type-dependent versions of a function (Serialize()). Ultimately, I want to be able to do something like in the code block below. I know that C# does not support template specialization. Is there a good workaround?