You could treat this just as an abstract base class and derive specific classes that specified the T value and provided the implementation for Total
public abstract class NumberContainer
where T: struct
{
public T ValueA { get; private set; }
public T ValueB { get; private set; }
public abstract T Total();
}
public class IntContainer : NumberContainer
{
public override int Total()
{
return ValueA + ValueB;
}
}