diff --git a/src/irr_ptr.h b/src/irr_ptr.h index 43add00da..f1caf9c7d 100644 --- a/src/irr_ptr.h +++ b/src/irr_ptr.h @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #include +#include #include "irrlichttypes.h" #include "IReferenceCounted.h" @@ -197,4 +198,12 @@ bool operator!=(const ReferenceCounted *a, const irr_ptr &b) n return a != b.get(); } +/** Same as std::make_unique, but for irr_ptr. + */ +template +irr_ptr make_irr(Args&&... args) +{ + return irr_ptr(new T(std::forward(args)...)); +} + // clang-format on