From 3f2822035b3f1c67e0d6ce410bf43e84b0846037 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 20 Mar 2023 23:22:04 +0000 Subject: Add persistence support for std::optional<>s --- lib/persistence.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/persistence.h b/lib/persistence.h index d38d4b1..cc2e4e5 100644 --- a/lib/persistence.h +++ b/lib/persistence.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -147,6 +148,10 @@ namespace Persistence { } }; + template struct SelectionT> : public SelectionT { + explicit SelectionT(std::optional & value) : SelectionT {value.emplace()} { } + }; + struct Persistable; struct PersistenceStore { using SelectionFactory = std::function; -- cgit v1.2.3