tokenise a string and building a multimap
<p>I have string like below:</p>

<pre><code>"1-1-2-1,1-1-3-1,1-2-3-4,2-3-4-5,2-3-5-8"
</code></pre>

<p>i want tokenise the string  and store it in a multimap,so that the map looks like below:</p>

<pre><code>key    value
1-1     2-1
1-1     3-1
1-2     3-4
2-3     4-5
</code></pre>

<p>well, i can split the string using the below function into a vector</p>

<pre><code>std::vector&lt;std::string&gt; &amp;split(const std::string &amp;s, char delim, std::vector&lt;std::string&gt; &amp;elems) 
{
    std::stringstream ss(s+' ');
    std::string item;
    while(std::getline(ss, item, delim)) 
    {
        elems.push_back(item);
    }
    return elems;
}
</code></pre>

<p>But i am out of any clue for creating a map as above.
could anybody please help?</p>
