Hacker News new | ask | show | jobs
by jheriko 4580 days ago
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

1 comments

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 :)