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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -