philip82148/cpp-dump

Macro CPP_DUMP -> cpp_dump

Closed this issue · 2 comments

This is an ADR(Architecture Decision Record) rather than an issue I will consider in the future.
But the discussion about this is open.

At first, the CPP_DUMP(...) macro was the cpp_dump(...) macro because "cpp_dump" is more readable and easier to type.
But since the namespace is cpp_dump, I thought there might be an unknown compiler problem, so I renamed it to the CPP_DUMP() macro.

// These can actually coexist
cpp_dump(args..); // macro not a function
cpp_dump::dump(args..); // namespace

If you want to use it as cpp_dump(...), you can use a macro.
(Macros are often avoided, but it's okay since this is for debugging use.)

#define cpp_dump(...) CPP_DUMP(__VA_ARGS__)

On second thought, I added cpp_dump().
I found an old and popular repository that does the same thing, so maybe I don't need to worry about compiler issues.
I do not intend to remove the original CPP_DUMP() for compatibility.

I deprecated uppercase CPP_DUMP() because it was awkward that there were two versions of the same macro.
I'll remove it after v0.7.0.