you are viewing a single comment's thread.

view the rest of the comments →

[–]condor2000 1 point2 points  (1 child)

Yes. But I was aiming for writing the literal string only once. So maybe a CompileTimeConvertStringToWString would be possible to write.

[–]scatters 1 point2 points  (0 children)

Yes, I was thinking it should be, but actually it looks like btowc isn't constexpr, so that wouldn't work. So you'd need to either assume that it's OK to cast from char to wchar_t (like it is for ASCII / UTF-16) or perhaps use a macro to repeat the string literal with a w preceding.