deserializing a csv stream to a vector of structures
<p>I have a Visual Studio 2008 C++ project where I would like to be able to take a list of comma-separated values stored in a std::stringstream and put them in a vector like this:</p>

<pre><code>struct Foo
{
    std::string A;
    std::string B;
    std::string C;
}

typedef std::vector&lt; Foo &gt; FooList; 

std::stringstream csv;  // contains comma separated values
</code></pre>

<p>Such that if the stream contained "My,Mother,Eats,\nDonuts,From,Menards", the resulting structure would be:</p>

<pre><code>{ { "My", "Mother", "Eats" },
  { "Donuts", "From", "Menards" } }
</code></pre>

<p>What's the best way to accomplish this? I was looking at using <code>boost.split</code> if there is a way to specify how the string is copied to the vector.</p>

<pre><code>FooList list;
boost::split( list, csv.str(), boost::is_any_of( "," ) );
</code></pre>

<p>I have control over the stream data, so if formatting it slightly differently makes things easier, I can do that.</p>
