c++ - std::list iterator, no operator "=" matches these operands -
it's first time using lists sorry if i'm doing stupid
std::list<abstractblock>::iterator i; (i = universe.getloadedblocks(); != universe.getloadedblocks().end; i++){ }
universe.getloadedblocks() returns , std::list<abstractblock>
list, keep getting error:
1 intellisense: no operator "=" matches these operands operand types are: std::_list_iterator<std::_list_val<std::_list_simple_types<abstractblock>>> = std::list<abstractblock, std::allocator<abstractblock>>
in first condition of for()
loop, trying assign std::list
std::list::iterator
, compiler complaining about. code needs more instead:
std::list<abstractblock>::iterator i; std::list<abstractblock> &blocks = universe.getloadedblocks(); (i = blocks.begin(); != blocks.end(); i++){ //... }
Comments
Post a Comment