I am trying to create a generic list of references to PointF
objects. (No, I am not looking to create a generic list of PointF
objects.) However, the following line fails to compile:
Generic::List<PointF^> ^pointList; // Generates error C3225
On the other hand, creating an array of PointF
references works without a problem as follows:
array<PointF^> ^points = gcnew array<PointF^>;
Here is a sample program:
using namespace System;
using namespace System::Drawing;
namespace Generic = System::Collections::Generic;
int main(array<System::String ^> ^args)
{
array<PointF^> ^points = gcnew array<PointF^>{
nullptr, PointF(0.0f, 0.0f), PointF(1.0f, 0.0f), nullptr
};
Generic::List<PointF^> ^pointList;
Console::WriteLine(L"Hello World");
return 0;
}
How do I create a generic list of PointF
references? In other words, how do I create a generic list of boxed PointF
s?