SymbolDatabase: Use range for loop

This commit is contained in:
Daniel Marjamäki 2020-01-26 07:31:04 +01:00
parent a5a294cf13
commit 625da9af5c
1 changed files with 8 additions and 9 deletions

View File

@ -3141,16 +3141,15 @@ void SymbolDatabase::printOut(const char *title) const
std::cout << "int"; std::cout << "int";
std::cout << std::endl; std::cout << std::endl;
std::cout << " enumClass: " << scope->enumClass << std::endl; std::cout << " enumClass: " << scope->enumClass << std::endl;
for (std::vector<Enumerator>::const_iterator enumerator = scope->enumeratorList.begin(); enumerator != scope->enumeratorList.end(); ++enumerator) { for (const Enumerator &enumerator : scope->enumeratorList) {
std::cout << " Enumerator: " << enumerator->name->str() << " = "; std::cout << " Enumerator: " << enumerator.name->str() << " = ";
if (enumerator->value_known) { if (enumerator.value_known)
std::cout << enumerator->value; std::cout << enumerator.value;
}
if (enumerator->start) { if (enumerator.start) {
const Token * tok = enumerator->start; const Token * tok = enumerator.start;
std::cout << (enumerator->value_known ? " " : "") << "[" << tok->str(); std::cout << (enumerator.value_known ? " " : "") << "[" << tok->str();
while (tok && tok != enumerator->end) { while (tok && tok != enumerator.end) {
if (tok->next()) if (tok->next())
std::cout << " " << tok->next()->str(); std::cout << " " << tok->next()->str();
tok = tok->next(); tok = tok->next();