From a6f3f335e931acd12b908ca0b4028a08c102627c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 29 Apr 2021 19:38:05 +0100 Subject: Extend factory map to include make_shared --- lib/persistance.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/persistance.h') diff --git a/lib/persistance.h b/lib/persistance.h index f797157..6e23272 100644 --- a/lib/persistance.h +++ b/lib/persistance.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -155,15 +156,17 @@ namespace Persistanace { } template static void addFactory() __attribute__((constructor)); - static void addFactory(const std::string_view, std::function()>); + static void addFactory(const std::string_view, std::function()>, + std::function()>); static std::unique_ptr callFactory(const std::string_view); + static std::shared_ptr callSharedFactory(const std::string_view); }; template void Persistable::addFactory() { - addFactory(typeName(), std::make_unique); + addFactory(typeName(), std::make_unique, std::make_shared); } template -- cgit v1.2.3