diff --git a/luna/include/luna/SharedPtr.h b/luna/include/luna/SharedPtr.h index 2ddf3b5d..8197f4ab 100644 --- a/luna/include/luna/SharedPtr.h +++ b/luna/include/luna/SharedPtr.h @@ -137,6 +137,12 @@ template Result> adopt_shared(T* ptr) return SharedPtr { ptr, ref_count }; } +template Result> make_shared(Args... args) +{ + T* raw_ptr = TRY(make(args...)); + return adopt_shared(raw_ptr); +} + template Result> adopt_shared_if_nonnull(T* ptr) { if (ptr) return adopt_shared(ptr);