A would be a C++ legitimate template doesn't work in C#:

public void PassDoubleArrayToList<T>( double [] x, List<T> items ) where T : struct
{
for( int i = 0; i < x.Count(); ++i )
{
items.Add( (T) x[i] );
}
}

The compiler complains: error CS0030: Cannot convert type 'double' to 'T'. Is there any work around? I would like to use only numeric types with T: double, int, bool, etc. I have tried a lot of ideas, so a piece of code would be appreciated greatly.