| 488 | /// Unsafely add and export the existing instance to this module. |
| 489 | template <typename T, typename... Args> |
| 490 | std::enable_if_t<IsEntityV<T>, void> |
| 491 | unsafeAddHostInstance(std::string_view Name, |
| 492 | std::vector<std::unique_ptr<T>> &OwnedInstsVec, |
| 493 | std::vector<T *> &InstsVec, |
| 494 | std::map<std::string, T *, std::less<>> &InstsMap, |
| 495 | std::unique_ptr<T> &&Inst) { |
| 496 | OwnedInstsVec.push_back(std::move(Inst)); |
| 497 | InstsVec.push_back(OwnedInstsVec.back().get()); |
| 498 | InstsMap.insert_or_assign(std::string(Name), InstsVec.back()); |
| 499 | } |
| 500 | |
| 501 | /// Unsafely find and get the exported instance by name. |
| 502 | template <typename T> |