2 ms·
Right, I thought about suggesting a macro for C/C++ but I don't know enough about their macro systems to know for sure that it would work
by brundolf 6y ago
Right, I thought about suggesting a macro for C/C++ but I don't know enough about their macro systems to know for sure that it would work
- nicoburns 6y agoI believe C++ has "Runtime Type Information" (RTTI) that allows you to do this. Although I also hear that it's not great.
- MaxBarraclough 6y agoTo expand on not great: RTTI is one of the few features of C++ where you pay for it even if you don't use it, so it's not all that popular. It can be disabled with compiler flags to shrink the binary. LLVM's coding standard prohibits use of RTTI, they instead use their own 'hand-rolled' solution. [0] RTTI is also banned by the Google C++ coding standard. [1] [0] https://llvm.org/docs/CodingStandards.html#do-not-use-rtti-or-exceptions https://llvm.org/docs/CodingStandards.html#do-not-use-rtti-o... [1] https://google.github.io/styleguide/cppguide.html#Run-Time_Type_Information__RTTI_ https://google.github.io/styleguide/cppguide.html#Run-Time_T...