Template related error for non-template code?
-
I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code:
struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); };
The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:I am the handsome one in the crowd.
-
I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code:
struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); };
The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:I am the handsome one in the crowd.
-
I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code:
struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); };
The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:I am the handsome one in the crowd.
Franz Klein wrote:
name_extractor variable(name);
This looks like a declaration of a member function
variable
that takes one parameter of unknown type. If you really mean to declare a function, all parameters must have their types declared, i.e.name_extractor variable (std::string& name);
-
I get the following error messages: c:\C++ Programs\StructViewer\parser.h(48) : error C2061: syntax error : identifier 'name' c:\C++ Programs\StructViewer\parser.h(50) : error C2061: syntax error : identifier 'var_type' for the following section of my code:
struct struct_info { struct_info() {}; std::string name; name_extractor variable(name); string var_type; type_extractor variable_type(struct_info::var_type); };
The struct declared above gets passed to a grammar rule that was defined using the Boost library. I am using Visual Studio 2003 on Win XP SP2. I am for the time being ignorant of the cause of the error. Can anyone help? :confused::sigh::confused:I am the handsome one in the crowd.
Franz Klein wrote:
name_extractor variable(name);
name
is not a type.Steve