在尝试移植一些代码以在linux中编译时,我得到了特殊的编译错误.通过代码库搜索,我终于设法将其归结为以下代码.
5: // include and using statements
6: template<typename RT, typename T1>
7: RT func(tuple<T1> const& t) {
8: return t.get<0>();
9: }
10: // test code
Run Code Online (Sandbox Code Playgroud)
试着用它我得到错误:
test.cpp: In function <functionName>:
test.cpp:8: error: expected primary-expression before ‘)’ token
Run Code Online (Sandbox Code Playgroud)
代码在Visual Studio中工作正常但由于某种原因我无法弄清楚为什么它不适用于g ++.这里的任何人都知道如何解决这个问题?