I have a class called ShadeRec and a class called World. The ShadeRec constructor takes a reference to a world like this: ShadeRec::ShadeRec(World& wr)
I need to initialise a new ShadeRec object in a function of the world class, like this: ShadeRec sr(*this);
However, this gives me a compiler saying that the world is being passed as const. this is the error:
World.cpp:12:19: error: no matching function for call to 'ShadeRec
st World&)'
How can I pass the world-reference as an argument without it being const? All of this code is taken directly from a book I'm following, so I find it a bit weird that it won't compile :p