| 3473 | } |
| 3474 | |
| 3475 | template<typename T> void AssignIndices(const std::vector<T *> &defvec) { |
| 3476 | // Pre-sort these vectors, such that we can set the correct indices for them. |
| 3477 | auto vec = defvec; |
| 3478 | std::sort(vec.begin(), vec.end(), compareName<T>); |
| 3479 | for (int i = 0; i < static_cast<int>(vec.size()); i++) vec[i]->index = i; |
| 3480 | } |
| 3481 | |
| 3482 | void Parser::Serialize() { |
| 3483 | builder_.Clear(); |