Copy link
@muggenhor

muggenhor Oct 13, 2015

Contributor

This causes a lot of problems when building with /Zc:wchar_t- on MSVC 9 (turns wchar_t into a typedef to unsigned short and does not #define _NATIVE_WCHAR_T_DEFINED, which causes boost/config/compiler/visualc.hpp to #define BOOST_NO_INTRINSIC_WCHAR_T).

Unfortunately code that uses this is not disabled with the same pre-processor guard: causing a whole range of compile errors. This while wchar_t strings can be and still are used even when it's a typedef to unsigned short.

So my question: why is this pre-processor guard here in the first place? (Removing it solves a lot of compile errors for me, although I haven't tested on a C++11 compiler).

Another possible approach (on Windows) would be to implement this for both the __wchar_t and unsigned short types (which are the two possible targets for the wchar_t target on Windows/MSVC). Although that may involve a lot more work than just expanding this single type-checking template and I'm not sure it adds more value.