How to overcome pointless C++ compiler warnings elegantly?

后端 未结 7 909
迷失自我
迷失自我 2021-01-01 10:12

This question is not bound to any specific compiler warning, the following is just an example.

Currently when I want a loop that checks an exit condition inside:

7条回答
  •  执念已碎
    2021-01-01 11:15

    Do some funny token pasting: if you can swap

    while(true)
    

    for

    While(true)
    

    then just do the following:

    #define while_true for( ;; )
    #define While(a) while_##a
    

提交回复
热议问题