Implement compiler intrinsics needed for compatibility with MSVC 2012 <type_traits>.

Patch by me and Ryan Molden.