title: C++/CLI: Boxing and Generic Lists
body: <p>I am trying to create a <a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx" rel="nofollow noreferrer">generic list</a> of references to <code>PointF</code> objects. (No, I am not looking to create a generic list of <code>PointF</code> objects.) However, the following line fails to compile:</p>
  
  <pre><code>Generic::List&lt;PointF^&gt; ^pointList; // Generates error C3225
  </code></pre>
  
  <p>On the other hand, creating an array of <code>PointF</code> references works without a problem as follows:</p>
  
  <pre><code>array&lt;PointF^&gt; ^points = gcnew array&lt;PointF^&gt;;
  </code></pre>
  
  <p>Here is a sample program:</p>
  
  <pre><code>using namespace System;
  using namespace System::Drawing;
  namespace Generic = System::Collections::Generic;
  
  int main(array&lt;System::String ^&gt; ^args)
  {
  
      array&lt;PointF^&gt; ^points = gcnew array&lt;PointF^&gt;{
          nullptr, PointF(0.0f, 0.0f), PointF(1.0f, 0.0f), nullptr
      };
  
      Generic::List&lt;PointF^&gt; ^pointList;
      Console::WriteLine(L"Hello World");
      return 0;
  }
  </code></pre>
  
  <p>How do I create a generic list of <code>PointF</code> references? In other words, how do I create a generic list of boxed <code>PointF</code>s?</p>