Netbeans C ++ template function return type

For some reason, code completion in netbeans cannot determine the return type of template functions. Take the following example ...

struct Test { int val; }; int main() { vector<Test> v; Test t = {10}; v.push_back(t); cout << v[0].val; //Netbeans gives the warning "Unable to resolve identifier val" return 0; } 

The code compiles and works fine, but what is annoying is that I get this error all over my code when using vectors. Also code completion does not work. When I type v [0]. there is not a single drop down list giving me the option to select val.

I use netbeans 7.4 along with 64-bit MinGW.

+7
c ++ netbeans
source share
3 answers

Well, there seems to be a bug in Netbeans version 7.2, and was later fixed.

https://netbeans.org/bugzilla/show_bug.cgi?id=172227

You can find the full discussion and possible resolution on the same issue at the following link. Here you can find how to solve this problem (maybe).

Netbeans 7.2 shows "Unable to resolve identifier" although assembly completed successfully

+5
source share

Follow a few simple steps to resolve your identifiers as indicated in the following link Netbeans 7.2 shows "Unable to resolve identifier" although assembly completed successfully 1

+1
source share

try to change

 struct Test { int val; }; 

from

 typedef struct { int val; } Test; 

in pure C, a "Test" will not be a specific type, but a "struct Test" will. By switching to typedef, you then have "Test" as a specific type.

0
source share

All Articles