c++ - How to get access to iterator of some type? -
i have code:
#include "nodesedgestriangles.h" triangles chain_triangulation( const listlimitations& input_list_limitations ) { edges edges_of_planar_graph; ( const_it_listlimitations location = input_list_limitations.begin(); location != input_list_limitations.end(); ++location ) //error line edges_of_planar_graph.insert( edges_of_planar_graph.end(), location->begin(), location->end() ); } triangles chain_triangulation; return chain_triangulation; } compiler give me error:
error c2839: invalid return type 'std::list<_ty> *const *' overloaded 'operator ->'
the variable input_list_limitations list of pointers other lists. means iterator "points" pointer list, when dereference iterator (with unary * or ->) have pointer , not instance. need double dereference able call begin , end functions, like
(*location)->begin() explanation:
*location dereferences iterator, give pointer std::list. -> operator used dereference pointer.
Comments
Post a Comment