This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I've defined this #define foreach(it, l) for(typeof(l.begin()) it = l.begin(); it != l.end(); it++) and then into main I have this: foreach(it, apariciones) { maxi = max(maxi, it->second); } where apariciones is a map<char, int> and the "it" is highlighted with red as it were a sintax error, but I have it at the top #define ... bla bla but, It is running so it isn't a critical problem, but would be fine if it were identified. that's it, thanks Product Version = NetBeans IDE 7.0.1 (Build 201107282000) Operating System = Windows XP version 5.1 running on x86 Java; VM; Vendor = 1.6.0_19 Runtime = Java HotSpot(TM) Client VM 16.2-b04
Example: #include <cstdlib> #include <map> #define foreach(it, l) for(typeof(l.begin()) it = l.begin(); it != l.end(); it++) using namespace std; int main(int argc, char** argv) { map<char, int> apariciones; int maxi; foreach(it, apariciones) { maxi = max(maxi, it->second); } for(map<char, int>::iterator it = apariciones.begin(); it != apariciones.end(); it++) { maxi = max(maxi, it->second); } return 0; }
"typeof" is not a part of C++ standard. It some kind of "decltype" from C++11 alias.