Has anyone ever had a use for the __COUNTER__ pre-processor macro?

前端 未结 16 1505
有刺的猬
有刺的猬 2020-11-29 00:37

The __COUNTER__ symbol is provided by VC++ and GCC, and gives an increasing non-negative integral value each time it is used.

I\'m interested to learn w

16条回答
  •  自闭症患者
    2020-11-29 01:05

    __COUNTER__ is guaranteed to be unique unlike __LINE__. Some compilers allow __LINE__ to be reset. #include files will also reset __LINE__.

提交回复
热议问题