I can't believe this actually has a name (is this an attempt to make fetch happen?) and it's not considered an anti-pattern. This sort of preprocessor/code mixing is impossible to debug and maintain; most senior C++ programmers have advised people to avoid doing this since the 1990's.
There is a role for the preprocessor to automate simple tables in C and such, but anything complex should be avoided like the plague if you don't like tech debt. And there's not much excuse for using it in C++ to this extent.
The vast majority of the use of X macros (and to be clear, they are not that common) I have seen in the wild have been very simple uses that are quite straightforward to debug.
Should we have a better solution in 2025? Yes. Lacking that, are X macros better than other workarounds? Also yes.
It's not particularly difficult to deal with, as far as C++ goes (I'd take it over most template shenanigans, the rules are a little simpler). It would be easier if C++ had ever tried to improve the preprocessor instead of just saying "don't use it" and trying to get templates to do a subset of the same kind of things you might want the preprocessor for.
(Also, there's a much better version of this I decribed above: mucking about with re-including the same file multiple times is unnecessary and constraints things too much. You can make a much nicer interface for users of the macro with only a little extra effort)
There is a role for the preprocessor to automate simple tables in C and such, but anything complex should be avoided like the plague if you don't like tech debt. And there's not much excuse for using it in C++ to this extent.