1. 编译时,error C2977 "std::tuple" too many template arguments问题的解决办法
打开 c:\program files (x86)\Microsoft Visual Studio 11.0\VC\include\xstddef,把 _VARIADIC_MAX定义成10。
这个方案一方面需要Administrator,其实是需要System权限才能修改Windows 8中的System文件,另一方面,会对所有的C/C++代码造成影响
坑爹吧?
/////////////////////////////////////////////
// date: 2012-12-11
上面的问题是vc的tr1/tuple引起的,后来高手指点下知道gtest是有一个宏来控制这个东东的,,,
// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
// is/isn't available.
// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
// compiler supports Microsoft's "Structured
// Exception Handling".
// GTEST_HAS_STREAM_REDIRECTION
// - Define it to 1/0 to indicate whether the
// platform supports I/O stream redirection using
// dup() and dup2().
// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
// Test's own tr1 tuple implementation should be
// used. Unused when the user sets
// GTEST_HAS_TR1_TUPLE to 0.
// Determines whether Google Test can use tr1/tuple. You can define
// this macro to 0 to prevent Google Test from using tuple (any
// feature depending on tuple with be disabled in this mode).
#ifndef GTEST_HAS_TR1_TUPLE
// The user didn't tell us not to do it, so we assume it's OK.
# define GTEST_HAS_TR1_TUPLE 1
#endif // GTEST_HAS_TR1_TUPLE
// Determines whether Google Test's own tr1 tuple implementation
// should be used.
#ifndef GTEST_USE_OWN_TR1_TUPLE
// The user didn't tell us, so we need to figure it out.
using vs2012
gtest tuple build error
gtestport.h
#define GTEST_USE_OWN_TR1_TUPLE 0
#define GTEST_HAS_TR1_TUPLE 0