Hello. 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 “no matching function” error.
Container<Foo> container ();
Bar * temp = new Bar(container);
What is wrong? Are not templates polymorphic?
Bu yazı alıntıdır. Yazının orjinal adresi aşağıda belirtilmiştir.
Yazının devamını okumak için buraya tıklayınız…