| 16 | } |
| 17 | |
| 18 | void UserDataContainer::do_add(Typeinfo* type, std::shared_ptr<UserData> data) { |
| 19 | auto ins = m_refkeeper.emplace(std::move(data)); |
| 20 | mgb_assert(ins.second, "duplicated user data: %p", ins.first->get()); |
| 21 | m_storage[type].push_back(ins.first->get()); |
| 22 | } |
| 23 | |
| 24 | std::pair<void* const*, size_t> UserDataContainer::do_get(Typeinfo* type) const { |
| 25 | auto iter = m_storage.find(type); |