【发布时间】:2011-05-16 00:17:26
【问题描述】:
(与我之前问过的unanswered question有关)。我想实现一个函数,该函数只能以相关类的向量作为参数调用。
对于情商
如果我们有
class A;
class B: public A;
class C: public A;
class D
then it should be possible to call function with vector<A*>,vector<B*> or
vector <C*> but not vector <D*>
任何建议
【问题讨论】:
标签: templates vector implementation idioms