I'm trying to initialize an instance of my class ShadeRec with its constructor:
ShadeRec(World& world);
So I pass to it:
ShadeRec sr(*this);
where "this" is an instance of the class World.
I get the following error:
World.cpp: In member function ‘ShadeRec World::hitObjects(const Ray&) const’:
World.cpp:52: error: no matching function for call to ‘ShadeRec::ShadeRec(const World&)’
ShadeRec.h:17: note: candidates are: ShadeRec::ShadeRec(const ShadeRec&)
ShadeRec.h:15: note: ShadeRec::ShadeRec(World&)
Assuming the problem is just that the World instance has the attribute const, how can I get rid of this error message?