I am trying to achieve something like the following:
#define def_name(delim, ...) ??? // how will this variadic macro concatenate its parameters to define a new variable?
// Calling `def_name` as follows should define a new variable.
def_name("_", "abc", "def", "ghi");
// The following code should be generated after invoking the above macro.
inline constexpr char const abc_def_ghi_name[]{"abc_def_ghi"};
// Invoking the macro as:
def_name("", "abc", "def", "ghi");
// should produce the following code:
inline constexpr char const abcdefghi_name[]{"abcdefghi"};
What should the def_name
macro be to support the above use-case? Also, can something similar be achieved at compile-time using C++ templates/constexpr?