> The reason for this is that if you currently use a macro like MY_LIB_ASSERT(x), then you have control over what it does, even when your header is used by someone else.
- Can you think of a way to guarantee the above is true?
For the interest of the conversation, I would confess upfront that I don’t know everything (unlike some among us in this august forum).
One way I know of protecting my macros from interference from the “outside” is to use #pragma push_macro, supported by GCC, Clang, and MSVC, to protect my macro definitions. Then interfering with it would require any of similar means as interfering with any other portion of the code that I author without macros. But, then again, I didn’t make the claim of the impossibility you made earlier.