In the following example, I would like to remove the std::wstring(std::widen(...)) part, but the '#' macro only returns a char string literal -- is there any way to accommodate a wchar?
#define FOO_MACRO(className)\
struct className##Factory : public OtherClass {\
// does some stuff here\
} className##Factory;\
someMap->add(std::wstring(std::widen(#className), className##Factory)))
How would I do the same thing using wchar?
You use an L prefix on the string literal to make a wchar string literal:
#define CAT(A, B)   A##B
#define WSTRING(A)  CAT(L, #A)
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With