c++ - g++ error message "use 'this->equal' instead?" -


i trying use stlplus ntree class , have written program using it, , have no problem compiling in windows environment. tried port unbuntu, have errors.

stlplus ntree class uses template. here example of code

ntree<rule_node_struct> t; ntree<rule_node_struct>::iterator cur_it; if (cur_it == t.root()) { // } 

when compiled using g++, following error message

in instantiation of ‘bool stlplus::ntree_iterator<t, tref, tptr>::operator==(const this_iterator&) const [with t = rule_node_struct; tref = rule_node_struct&; tptr = rule_node_struct*; stlplus::ntree_iterator<t, tref, tptr>::this_iterator = stlplus::ntree_iterator<rule_node_struct, rule_node_struct&, rule_node_struct*>]’:  /usr/lib/stlplus3-03-08/containers/ntree.tpp:133:19: error: ‘equal’ not declared in scope, , no declarations found argument-dependent lookup @ point of instantiation [-fpermissive]  /usr/lib/stlplus3-03-08/containers/ntree.tpp:133:19: note: declarations in dependent base ‘stlplus::safe_iterator<stlplus::ntree<rule_node_struct>, stlplus::ntree_node<rule_node_struct> >’ not found unqualified lookup  /usr/lib/stlplus3-03-08/containers/ntree.tpp:133:19: note: use ‘this->equal’ instead 

why g++ has error while windows visual studio not?

that seems bug in ntree class, g++ proper two-phase lookup of symbols, while vc seems accept broken code. note earlier versions of g++ accepted kind of code (afaik) , therefore got fixed in latest version in repository. although version 2010. seems me never made release, use head version or ask them release.


Comments