summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/persistence.h5
1 files changed, 5 insertions, 0 deletions
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 <iosfwd>
#include <map>
#include <memory>
+#include <optional>
#include <span>
#include <special_members.hpp>
#include <sstream>
@@ -147,6 +148,10 @@ namespace Persistence {
}
};
+ template<typename T> struct SelectionT<std::optional<T>> : public SelectionT<T> {
+ explicit SelectionT(std::optional<T> & value) : SelectionT<T> {value.emplace()} { }
+ };
+
struct Persistable;
struct PersistenceStore {
using SelectionFactory = std::function<SelectionPtr()>;