オブジェクトへの参照の一般的なリストを作成しようとしていPointF
ます。(いいえ、オブジェクトの一般的なリストを作成するつもりはありませんPointF
。)ただし、次の行はコンパイルに失敗します。
Generic::List<PointF^> ^pointList; // Generates error C3225
一方、PointF
参照の配列の作成は、次のように問題なく機能します。
array<PointF^> ^points = gcnew array<PointF^>;
サンプルプログラムは次のとおりです。
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;
}
参照の一般的なリストを作成するにはどうすればよいPointF
ですか? つまり、ボックス化された s の一般的なリストを作成するにはどうすればよいPointF
ですか?