Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ __COUNTER__ Definition

I have two versions of a c++ compiler installed on my computer. One of them recognizes the __COUNTER__ macro and the other does not. After doing some research to make the program compile in both I have yet to come across the Macro definition for __COUNTER__. Is this some special Macro done by the compiler or can I copy the definition for __COUNTER__ into my source code, if I can copy it what is the code I need.

like image 469
Gibby Avatar asked Dec 20 '22 20:12

Gibby


1 Answers

__COUNTER__ is a built-in in several common compilers. It is not possible to define manually. If you're stuck with a compiler that doesn't support it, your best option might be to run your code through a preprocessor that does support it before feeding it into the compiler.

like image 95
icktoofay Avatar answered Jan 03 '23 17:01

icktoofay