3 ms·
This header would be much more useful if it suggested safe alternatives for each of the functions it poisions
by CJefferson 13y ago
This header would be much more useful if it suggested safe alternatives for each of the functions it poisions
- hsmyers 13y agoHas GCC got the necessary pragma foo to implement this?
- CJefferson 13y agoProbably not, but could put comments in the header?
- jheriko 13y agoone 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
- panzi 13y agoThen I'll just use a C-style cast. :P
- jheriko 13y agodon'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 :)
- yetanotherphd 13y agoif it does, it should be called antidote.
- jevinskie 13y agoClang has "fixit"s for this but they are defined in its checker code, you can't specify custom ones in your own source/header. Though you could probably do so by writing a plugin!