}
Bundle::Bundle(const Bundle& b) {
- for (const auto& [key, val] : b.map_) {
- const KeyInfo& info = *val;
- auto new_val = std::make_shared<KeyInfo>(info);
- map_[key] = new_val;
+ for (const auto& info : b.list_) {
+ auto new_val = std::make_shared<KeyInfo>(*info);
+ map_[info->GetKey()] = new_val;
list_.push_back(std::move(new_val));
}
}
if (this != &b) {
map_.clear();
list_.clear();
- for (const auto& [key, val] : b.map_) {
- const KeyInfo& info = *val;
- auto new_val = std::make_shared<KeyInfo>(info);
- map_[key] = new_val;
+ for (const auto& info : b.list_) {
+ auto new_val = std::make_shared<KeyInfo>(*info);
+ map_[info->GetKey()] = new_val;
list_.push_back(std::move(new_val));
}
}