Hacker News new | ask | show | jobs
by hsmyers 4580 days ago
Has GCC got the necessary pragma foo to implement this?
3 comments

one of my favourite old school tricks for achieving such breakery is:

#define const_cast CONST_CAST_IS_FORBIDDEN #define dynamic_cast DYNAMIC_CAST_IS_NEVER_NECESSARY

etc...

its dirty, but it gets the job done

Then I'll just use a C-style cast. :P
don't worry, i can't do this across /all/ code anymore - some lazy ms monkeys were unkind enough to dump dynamic casts in library headers sometime around 2008.

C-style cast at least doesn't make you pay through the nose in debug time or performance overheads - even if it is easily confusing :)

Probably not, but could put comments in the header?
if it does, it should be called antidote.