| 16 | } |
| 17 | |
| 18 | void NamedStats::print() |
| 19 | { |
| 20 | long sum = 0; |
| 21 | for (auto x : *this) |
| 22 | sum += x.second; |
| 23 | if (sum > 0) |
| 24 | cerr << "Detailed costs:" << endl; |
| 25 | for (auto x : *this) |
| 26 | { |
| 27 | if (x.second > 0) |
| 28 | { |
| 29 | cerr.fill(' '); |
| 30 | cerr << " "; |
| 31 | cerr << setw(10) << x.second << " " << x.first << endl; |
| 32 | } |
| 33 | } |
| 34 | } |