Quote:
Originally Posted by jfwfmt
typedef class key_word key_word_T;
typedef class key_word_sort key_word_sort_T;
Your typedefs are unnecessary in C++ you can use the class name as the type name without the class keyword (same goes for structs unions and enums) so you can declare your variables as
-
set <key_word, key_word_sort> global_keys; // all keywords
-
set <key_word, key_word_sort> local_keys; // this document's keywords
-
pair<set<key_word, key_word_sort>::iterator, bool> global_result;
-
pair<set<key_word, key_word_sort>::iterator, bool> local_result;
-
set<key_word, key_word_sort>::iterator global_itor;
-
set<key_word, key_word_sort>::iterator local_itor;
-
Talking of variables that is an awful lot of global variables you have there, I would consider that bad practice in C let alone C++.
(*global_itor).inc(); // want to invoke key_word.inc() on global_keys copy
The iterator is a pointer to your type so this should work although I would write it as
global_itor->inc(); // want to invoke key_word.inc() on global_keys copy
but the 2 syntaxes have the same meaning.
Did it produce any compiler diagnostics?