C++ stringstream error: no match for operator<< for operand types std::string and const unsigned int
<p>I have this function which receives a <code>const vector</code> of <code>&lt;unsigned int, unsigned int&gt;</code> pairs:</p>

<pre><code>// Type definitions
typedef std::pair&lt;unsigned int, unsigned int&gt; IdsPair;
typedef std::vector&lt;IdsPair&gt; IdsPairList;
typedef IdsPairList::const_iterator IdsPairIterator;

void Foo(const IdsPairList myPairsList){
    std::stringstream ss;
    ss &lt;&lt; "List of ids: (";
    for(IdsPairIterator idPair = myPairsList.begin();
        idPair != myPairsList.end(); idPair++){
        ss &lt;&lt; (idPair-&gt;first == myPairsList.begin()) ? "" : "," &lt;&lt; idPair-&gt;first; // ERROR
    }
    ss &lt;&lt; ")";
    std::string query = ss.str();
}
</code></pre>

<p>At the line selected with <code>// ERROR</code>, I am getting the following error:</p>

<pre><code>error: no match for ‘operator&lt;&lt;’ (operand types are ‘std::string {aka std::basic_string&lt;char&gt;}’ and ‘const unsigned int’)
</code></pre>

<p>I have no clue what the problem is, since stringstream is supposed to convert the unsigned int to string.</p>

<p>Any help? I'm using C++98</p>