I have this structure of classes.

class Interface {
  // ...
};

class Foo : public Interface {
  // ...
};

template <class T>
class Container {
  // ...
};

And I have this constructor of some other class Bar.

Bar(const Container<Interface> & bar){
  // ...
}

When I call the constructor this way I get a "no matching function" error.

Container<Foo> container ();

Bar * temp = new Bar(container);

What is wrong? Are templates not polymorphic?

Edit
Report