1

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?

1 Answer 1

2

Stringification can only be done by MACRO.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.