Inserting iterator range in std::vector
<p>I have a multiset and I'm getting a range from it. I want to add this range in a vector to use it later, this is what I'm doing:</p>

<pre><code>class foo
{
    public:
        int a;
        foo(int a) : a(a){}
};
class FooPointerCompare
{
    public:
        bool operator()(const foo* a, const foo* b)
        {
            return a-&gt;a &lt; b-&gt;a;
        }
};

std::multiset&lt;foo*, FooPointerCompare&gt; m;
std::vector&lt;std::multiset&lt;foo*, FooPointerCompare&gt;::iterator&gt; v;
auto pair = m.equal_range(new foo(5)); //leak here, I know
v.insert(v.end(), pair.first, pair.second);
</code></pre>

<p>but I get these errors:</p>

<pre><code>No matching constructor for initialization of 'std::__1::__tree_const_iterator&lt;foo *, const std::__1::__tree_node&lt;foo *, void *&gt; *, int&gt;'

No viable overloaded '='
</code></pre>

<p>when I use a simple <code>for(auto it = pair.first; it != pair.second; it++) v.push_back(it);</code> it works perfectly. What is wrong with my <code>vector::insert</code> call?</p>
