This is rather frustrating... are std::list's and std::vector's begin() and end() not marked as const? Whenever I try to use them, I get the error:
Code:
Terrain.cpp: In member function ‘const Chunk* Terrain::getContainingChunk(float, float, float) const’:
Terrain.cpp:40: error: conversion from ‘std::_List_const_iterator<Chunk*>’ to non-scalar type ‘std::_List_iterator<Chunk*>’ requested
Which is annoying. I cant iterate through a std::list and at the same time call the member function const, even though it's not changing anything by iterating.
There must be a better way to this. What might it be? My function must be const, and it must iterate through a std::list, returning the matching chunk of terrain.
Bookmarks