Corno wrote:
Hi all,
should the following code compile?
void test(std::set<Thing *> things, Thing * const thing)
{
things.erase(thing);
}
My compiler complains that it cannot convert Thing * const to Thing *, but
why should it need a non const pointer as this instance is not going to be
changed?
Why do you pass the pointer as const at all?
You don't gain anything by doing it.
--
Karl Heinz Buchegger
kbuchegg@gascad.at
.
|