palladium/include/pd/smart_ctor.hpp

11 lines
371 B
C++
Raw Normal View History

2024-07-12 19:48:34 +02:00
#pragma once
#include <memory>
#define PD_SMART_CTOR(type) \
using Ref = std::shared_ptr<type>; \
template <typename... args> \
static Ref New(args&&... cargs) { \
return std::make_shared<type>(std::forward<args>(cargs)...); \
}