c++ template for std::vector with custom memory allocator
<p>I want to make a template for an argument of a function.</p>

<p>The argument is a <code>std::vector&lt;type&gt;</code> with an allocator.</p>

<p>The default is to use the default memory allocator, but custom allocator can also be used.</p>

<p>The following code doesn't work. How to fix this?</p>

<pre><code>template &lt;typename T, typename T2=std::allocator&lt;T&gt;&gt;
void pad_zero(std::vector&lt;T,T2&gt; vec, uint32_t n){
    uint32_t i;
    for (i = 0; i &lt; n; i++){
        vec.push_back(0);
    }
}
</code></pre>

<p>Thanks.</p>