Quicker way to insert into list?
<p>I'm having a hard time writing an efficient way to insert a large volume of values into a list, without using maps.  The code I have currently looks as follows:</p>

<pre><code>list&lt;pair&lt;int, vector&lt;int&gt;&gt;&gt; myList;

void key_value_sequences::insert(int key, int value){
    for(it=myList.begin(); it!=myList.end(); ++it){
        if(it-&gt;first==key){
            it-&gt;second.push_back(value);
            return;
        }
    }
    vector&lt;int&gt; v;
    v.push_back(value);
    myList.push_back(make_pair(key, v));
    myList.sort();
    return;
};
</code></pre>

<p>Any help is greatly appreciated.</p>