maradydd: (Default)
maradydd ([personal profile] maradydd) wrote2009-05-14 04:50 am
Entry tags:

(no subject)

I love const_cast and it loves me back. (It's hard to go wrong adding const to things as long as you're confident that it's okay for them to be immutable. These totally are.)

[identity profile] maradydd.livejournal.com 2009-05-16 01:20 pm (UTC)(link)
Whoops, you've just exposed some sloppy thinking on my part. I should have said "reference to const pointer to const int", following the what-comes-before-it rule -- there's a const after the *, and the other one precedes the int but there's nothing before that, so it applies to the int.

For some reason, in my head that parses as "const reference". I suspect g++ error messages have something to do with it.

Thanks for the catch!

[identity profile] marapfhile.livejournal.com 2009-05-16 02:24 pm (UTC)(link)
happy to help, and glad to see something stuck from my one attempt to clean up some bad c++ at work.