I have a series of #defines that I want assigned consecutive numbers at compile time so I can refer to them later and know their order. Currently, I'm assigning a number to each #define in order, but, if I change the order, I have to renumber the #defines.
#define THING_A 1 // I'm doing this now...
#define THING_F 2
#define THING_C 3
#define THING_B 4
Not shown: these #define are between array elements and refer to the element order. I often need to rearrange the element order. If I reorder them, as below, I want their numbers to change accordingly without me having to go through and edit the numbers like this:
#define THING_C 1
#define THING_A 2
#define THING_B 3
#define THING_F 4
What can I replace the numbers with (the same for every #define) that will result in consecutive assignments? I can't use "__COUNTER_" like this...
#define THING_B (__COUNTER__)
... because every time I use the defined value later, it gets larger. What is this "(something)"?
#define THING_A (something)
#define THING_B (something)
#define THING_C (something)
#define THING_D (something)