Initial Commit
This commit is contained in:
10
include/pd/smart_ctor.hpp
Normal file
10
include/pd/smart_ctor.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#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)...); \
|
||||
}
|
||||
Reference in New Issue
Block a user