Please Explain This Piece of Code
<p>So I have been attempting to split a string in C++ and dump the contents into a vector. I found an answer to the problem so I copied the solution and started playing around with it to understand it but it still appears to be very cryptic. I have the following snippet of code which is a mix of stuff I made and copied material. I have commented every line that I understand the purpose of. Could someone fill in the remaining comments (basically explaining what they do). I would like to fully understand how this is solved.</p>

<pre><code>ifstream inputfile; //declare file
inputfile.open("inputfile.txt"); //open file for input
string m; //declare string
getline(inputfile, m); //take first line from file and insert into string

std::stringstream ss(m);
std::istream_iterator&lt;std::string&gt; begin(ss);
std::istream_iterator&lt;std::string&gt; end;
std::vector&lt;std::string&gt; vstrings(begin, end);
std::copy(vstrings.begin(), vstrings.end(), std::ostream_iterator&lt;std::string&gt;(std::cout, "\n"));

while(true) //delay the cmd applet from closing
{
}
</code></pre>
