There are several things wrong with your code, here is a working example:
template class TContainer, class TObject>
class Foobar
{
public:
explicit Foobar( TContainer> & container )
:
container_( container ){}
private:
TContainer> & container_;
};
int main()
{
std::vector v;
Foobar bla( v );
}
The main fault of your codes it that std::vector
takes two template arguments.
It looks like this template> class vector;
. Also, Joachim Pileborg is right about the double pointer issue, IUnknown**
.
However, you could simplify your code with the following:
template
class Foobar
{
public:
explicit Foobar( TContainer & container )
:
container_( container ){}
private:
TContainer & container_; // Be careful with reference members
};
int main()
{
std::vector v;
Foobar> bla( v ); // C++11 decltype(v) could be used
}