whats the difference between these two access methods?
nodes->at(235).push_back(NavigationNode(NULL,0,0));
nodes[235].push_back(NavigationNode(NULL,0,0));
second one gives this compile error
cannot convert parameter 1 from 'PathFinder::NavigationNode' to 'const std::vector<_Ty> &'
i’m very confused about this error
It depends whether
nodesis avectoror avector *(or an iterator).If the first one compiles, then it must be a
vector *(or an iterator). In which case the second one would need to become:Note, however, that accessing via
operator[]and viaat()have different semantics. The latter will do a bounds check.