comparison widgets/SubdividingMenu.cpp @ 1358:53fe33b00770

Oops, typeof is not standard
author Chris Cannam
date Thu, 11 Oct 2018 18:26:30 +0100
parents edfc38ade098
children
comparison
equal deleted inserted replaced
1355:b9bfcb8cd5a1 1358:53fe33b00770
83 83
84 auto comparator = [](QString s1, QString s2) -> bool { 84 auto comparator = [](QString s1, QString s2) -> bool {
85 return QString::localeAwareCompare(s1, s2) < 0; 85 return QString::localeAwareCompare(s1, s2) < 0;
86 }; 86 };
87 87
88 set<QString, typeof(comparator)> sortedEntries(comparator); 88 set<QString, decltype(comparator)> sortedEntries(comparator);
89 sortedEntries.insert(entries.begin(), entries.end()); 89 sortedEntries.insert(entries.begin(), entries.end());
90 90
91 for (auto j = sortedEntries.begin(); j != sortedEntries.end(); ++j) { 91 for (auto j = sortedEntries.begin(); j != sortedEntries.end(); ++j) {
92 92
93 #ifdef DEBUG_SUBDIVIDING_MENU 93 #ifdef DEBUG_SUBDIVIDING_MENU
178 // again, for the set passed to it, but we need the same sorting 178 // again, for the set passed to it, but we need the same sorting
179 // for the subsequent loop in this function as well) 179 // for the subsequent loop in this function as well)
180 auto comparator = [](QString s1, QString s2) -> bool { 180 auto comparator = [](QString s1, QString s2) -> bool {
181 return QString::localeAwareCompare(s1, s2) < 0; 181 return QString::localeAwareCompare(s1, s2) < 0;
182 }; 182 };
183 set<QString, typeof(comparator)> sortedEntries(comparator); 183 set<QString, decltype(comparator)> sortedEntries(comparator);
184 for (auto i: m_pendingEntries) { 184 for (auto i: m_pendingEntries) {
185 sortedEntries.insert(i.first); 185 sortedEntries.insert(i.first);
186 } 186 }
187 187
188 for (QString entry: sortedEntries) { 188 for (QString entry: sortedEntries) {