| 479 | /// Unsafely create and add the instance to this module. |
| 480 | template <typename T, typename... Args> |
| 481 | std::enable_if_t<IsInstanceV<T>, void> |
| 482 | unsafeAddInstance(std::vector<std::unique_ptr<T>> &OwnedInstsVec, |
| 483 | std::vector<T *> &InstsVec, Args &&...Values) { |
| 484 | OwnedInstsVec.push_back(std::make_unique<T>(std::forward<Args>(Values)...)); |
| 485 | InstsVec.push_back(OwnedInstsVec.back().get()); |
| 486 | } |
| 487 | |
| 488 | /// Unsafely add and export the existing instance to this module. |
| 489 | template <typename T, typename... Args> |