When using the -fno-rtti option of the GCC style clang++, using typeid results in an error. The MSVC STL however kindly provides a define flag called _HAS_STATIC_RTTI, which either enables or disables uses of typeid throughout the STL. By default, if undefined, it is set to 1, enabling the use of typeid.
With this patch, _HAS_STATIC_RTTI is set to 0 when -fno-rtti is specified. This way various headers of the MSVC STL like functional can be consumed without compilation failures.
Some context: I was first made aware of this define in this bug report regarding twoPhase lookup: https://bugs.chromium.org/p/chromium/issues/detail?id=996675
Back then however there was still a usage of typeid left unguarded, which has since been fixed in this commit https://github.com/microsoft/STL/issues/340.
Since that is November 2019, so a rather recent version of MSVC, this will not work in versions prior to this fix.
For compat one could maybe allow typeid(void), but that is beyond the scope of this patch either way I think.