为什么gcc认为我试图在我的模板函数签名中进行函数调用?

Nie*_*Wet 1 c++ gcc templates

GCC似乎认为我正在尝试在我的模板函数签名中进行函数调用.谁能告诉我以下有什么问题?

227 template<class edgeDecor, class vertexDecor, bool dir>
228 vector<Vertex<edgeDecor,vertexDecor,dir>> Graph<edgeDecor,vertexDecor,dir>::vertices()
229 {
230 return V;
231 };
Run Code Online (Sandbox Code Playgroud)

GCC正在提供以下内容:

graph.h:228: error: a function call cannot appear in a constant-expression
graph.h:228: error: template argument 3 is invalid
graph.h:228: error: template argument 1 is invalid
graph.h:228: error: template argument 2 is invalid
graph.h:229: error: expected unqualified-id before ‘{’ token
Run Code Online (Sandbox Code Playgroud)

非常感谢.

Tad*_*pec 10

你应该把空间放在两个之间>.>>被解析为位移运算符,而不是两个右括号.