std::tr1 with visual studio 2017
One option is to re-enable TR1; do this by defining the macro _HAS_TR1_NAMESPACE
, as briefly mentioned in this blog article. If you're using an MSBuild project then this is best done by way of your project's Preprocessor Definitions setting; or if you're using a precompiled header, by defining it at the top of said PCH.
A better option is to inform GTest that your compiler supports C++11 by defining the macro GTEST_LANG_CXX11
to 1
before including any GTest headers; then it will use std::tuple
rather than std::tr1::tuple
*. (GTest's C++11-detection logic is __cplusplus
-oriented, which VC++ has not yet updated despite being mostly C++11 and C++14 compliant. I would say this is a bug in GTest since it supports VC++ elsewhere throughout the configuration logic.)
* Not to mention the other C++11 features, which is why this is by far the better option ;-]
Googletest release 1.8.1 fixes this issue (in combination with VS2017 15.8.5).