| Summary: | GCC 3.3.1 TEMPLATE PROBLEMS | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | dragon |
| Component: | general | Assignee: | KDevelop Developers <kdevelop-devel> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 3.0.0b1 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
> This is not so much a KDE problem as it is a GCC problem Why did you report it to KDE then? Please note that you have a std::pair as the iterator's dereferencing. Aren't you forgetting to add .second ? for (field_list_t::const_iterator i = p.second->fields.begin(); i != p.second->fields.end(); ++i) os << (*i)->field_name().second << " "; See: http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.3/structstd_1_1pair.html |
Version: 3.0.0b1 (using KDE 3.1.4) Installed from: SuSE Compiler: gcc version 3.3.1 (SuSE Linux) OS: Linux (i686) release 2.4.21-99-athlon This is not so much a KDE problem as it is a GCC problem However, that are some serious issue about GCC template handleing ex. Given the following two output operators // // // std::ostream& operator <<(std::ostream& os, const Authorization::db_to_info_t& p) { os << "Database Id: " << std::hex << p.first << std::dec << "\tCreation Transaction#: " << p.second.creation_transaction_no << "\tUpdate Version: " << unsigned(p.second.update_version); return os; } std::ostream& operator <<(std::ostream& os, const DatabaseDefinitions::db_to_db_info_t& p) { os << p.second->database_name << "=" << std::hex << p.first << std::dec << " " << p.second->number_of_record << " " << p.second->base_record_lenght << " " << p.second->eqs_record_lenght << " " << p.second->xRefFileName() << " " << p.second->security_type.security_type_number << "=" << p.second->security_type.name << " " << p.second->number_of_base_fields << " " << p.second->number_of_eqs_fields; os << std::endl; for (field_list_t::const_iterator i = p.second->fields.begin(); i != p.second->fields.end(); ++i) os << (*i)->field_name() << " "; os << std::endl; return os; } The following lines of code std::cout << "Database Definitions" << std::endl; for (DatabaseDefinitions::map_t::const_iterator i = Database_Definitions->database_information().begin(); i != Database_Definitions->database_information().end(); ++i) std::cout << *i << std::endl; Generates errors /home/XMan/Documents/C++/DTN/dtnserver/src/verbose_display.cpp:147: error: ambiguous overload for 'operator<<' in 'std::cout << (&i)->std::_Rb_tree_iterator<_Val, _Ref, _Ptr>::operator*() const [with _Val = std::pair<const long unsigned int, DTN::Database::database_information_s*>, _Ref = const std::pair<const long unsigned int, DTN::Database::database_information_s*>&, _Ptr = const std::pair<const long unsigned int, DTN::Database::database_information_s*>*]()' * /home/XMan/Documents/C++/DTN/dtnserver/src/verbose_display.cpp:74: error: candidates are: std::ostream& operator<<(std::ostream&, const std::pair<long unsigned int, DTN::IO::ResponseToAuthorizeDatabase::a_db_authorization>&) * /home/XMan/Documents/C++/DTN/dtnserver/src/verbose_display.cpp:106: error: std::ostream& operator<<(std::ostream&, const std::pair<long unsigned int, DTN::Database::database_information_s*>&) The GCC template handling functions can't tell the difference between the two operators.