c++ easy way to convert macro variable to wchar string literal -
c++ easy way to convert macro variable to wchar string literal -
in next example, remove std::wstring(std::widen(...))
part, '#' macro returns char string literal -- there way accommodate wchar?
#define foo_macro(classname)\ struct classname##factory : public otherclass {\ // stuff here\ } classname##factory;\ somemap->add(std::wstring(std::widen(#classname), classname##factory)))
how same thing using wchar?
you utilize l
prefix on string literal create wchar string literal:
#define cat(a, b) a##b #define wstring(a) cat(l, #a)
c++ macros
Comments
Post a Comment