Hi
I'm facing a problem which I'm unable to solve using STL containers.
Consider this:
class Mesh
{
public:
const std::list<SubMesh>& getSubmeshList();
}
I want to be able to modify the objects contained in the list returned by Mesh::getSubmeshList, but want to disable access to inserting/erasing items from the collection. However, since I'm returning a const reference to the list, I can only use a const_iterator which only gives me access to const items.
Is there any way around this without using const_cast? Should I rethink my design?