I have a class like this:
class Foo
{
...
template<template<typename...> class container>
void fillContainer(container<int> &out)
{
//add some numbers to the container
}
...
}
I did it this way to be able to handle different stl Containers. Now I want to create a specialization for std::vector to reserve the Memory (I know the amount of numbers to insert). I read this and this post, so I did the following:
class Foo
{
//Same Thing as above
}
template<>
void Foo::fillContainer(std::vector<int> &out)
{
//add some numbers to the container
}
Now I get the error: error: no member function 'fillContainer' declared in 'Foo'
. I guess the Problem is template<template<typename...> class container>
.
Is there a possibility to specialize this function for std::vector
?