What\'s wrong with this line of code?
bar foo(vector ftw);
It produces
error C2061: syntax error: identifier \'vector\'
On its own, that snippet of code has no definition of bar
, vector
or odp
. As to why you're not getting an error about the definition of bar
, I can only assume that you've taken it out of context.
I assume that it is supposed to define foo
as a function, that vector
names a template and that it is supposed to define a parameter called ftw
but in a declaration anything that is not actually being defined needs to have been declared previously so that the compiler knows what all the other identifiers mean.
For example, if you define new types as follows you get a snippet that will compile:
struct bar {};
struct odp {};
template struct vector {};
bar foo(vector ftw);