0

In C, it is quite common to capture argument as string literl via macro as mentioned in this answer:

#define CALL_DO_SOMETHING(VAR) do_something(#VAR, VAR);

But on the other hand, there are many projects with policies against the usage of macro and recommend always using templates instead.

I am wondering if it is possible to express the similar syntax in a modern C++ way or it is yet another corner case where macro has to be used?

Lifu Huang
  • 11,930
  • 14
  • 55
  • 77

1 Answers1

1

Stringification can only be done by MACRO.

Lifu Huang
  • 11,930
  • 14
  • 55
  • 77
Jarod42
  • 203,559
  • 14
  • 181
  • 302