我很难找到有关这些东西的信息!:(
我很困惑为什么这不起作用:
vector<B*> b;
vector<C*> c;
(B and C are subclasses of A)
(both are also initialized and contain elements etc etc...)
template <class First, class Second>
bool func(vector<First*>* vector1, vector<Second*>* vector2)
return vector1 == vector2;
编译时返回:
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
我不明白为什么这不起作用,指针保存地址是吗?那么为什么不比较两个向量指针...是否指向相同的地址(-es)?