C2977: 'std::tuple' : too many template arguments (MSVC11)

前端 未结 7 1997
清歌不尽
清歌不尽 2020-12-13 03:53

I\'m trying to build googletest with Visual C++ 11, but following code causes an error

template 

        
7条回答
  •  青春惊慌失措
    2020-12-13 04:40

    Check out this entry in the msdn blog. VC++11 doesn't have support for variadic templates. They have something they call faux variadics. Scroll down and you will see a paragraph on Faux variadics that talks about tuples. On that paragraph they say the default maximum number of parameters is 5. You can increase it to 10:

    You can define _VARIADIC_MAX project-wide between 5 and 10 inclusive (it defaults to 5). Increasing it will make the compiler consume more memory, and may require you to use the /Zm option to reserve more space for PCHes.

    They say they have a fix incoming to make the default 10 again.

提交回复
热议问题