I need some help here, how is such a type mismatch even possible?
When I substitute everything in, it is exactly the same type including
constness.
cgVertex3D.cpp:33: error: no matching function for call to
std::vector<Polygon3D*, std::allocator<Polygon3D*> >::push_back(const Polygon3D*&)
/usr/include/c++/4.4/bits/stl_vector.h:733:
note: candidates are:
void std::vector<_Tp, _Alloc>::push_back(const _Tp&)
[with _Tp = Polygon3D*, _Alloc = std::allocator<Polygon3D*>]
<near match>
It’s
_Tpthat isconst, and in this case_Tpis a pointer. So the substitution forconst _Tpwill actually result inPolygon3D *const, notconst Polygon3D *, hence the mismatch.