Why does gcc think that I am trying to make a function call in my template function signature?

Posted by nieldw on Stack Overflow See other posts from Stack Overflow or by nieldw
Published on 2010-03-22T10:52:21Z Indexed on 2010/03/22 11:01 UTC
Read the original article Hit count: 328

Filed under:
|
|
|

GCC seem to think that I am trying to make a function call in my template function signature. Can anyone please tell me what is wrong with the following?

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

GCC is giving the following:

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

Thanks a lot.

© Stack Overflow or respective owner

Related posts about gcc

Related posts about c++