Why do I need double layer of indirection for macros?

后端 未结 5 1521
执念已碎
执念已碎 2020-11-29 02:42

At: C++ FAQ - Miscellaneous technical issues - [39.6] What should be done with macros that need to paste two tokens together?

Could someone explain to me wh

5条回答
  •  死守一世寂寞
    2020-11-29 03:37

    The order in which macros are declared is not important, the order in which they are used is. If you were to actually use that macro before it was declared -- (in actual code that is, not in a macro which remains dormant until summoned) then you would get an error of sorts but since most sane people don't go around doing these kinds of things, writing a macro and then writing a function that uses a macro not yet defined further down, etc,etc... It seems your question isn't just one question but I'll just answer that one part. I think you should have broken this down a little more.

提交回复
热议问题