From 6713b56da687e86f4f490b75e4b8eb134eb3dc83 Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Tue, 1 Jun 2021 23:41:32 +0200 Subject: [PATCH] Moved nullopt monostate out of optional --- include/gp/functional/monostates.hpp | 7 +++++++ include/gp/functional/optional.hpp | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 include/gp/functional/monostates.hpp diff --git a/include/gp/functional/monostates.hpp b/include/gp/functional/monostates.hpp new file mode 100644 index 0000000..2cac761 --- /dev/null +++ b/include/gp/functional/monostates.hpp @@ -0,0 +1,7 @@ +#pragma once + +namespace gp{ + struct nullopt_t final{}; + + constexpr nullopt_t nullopt; +} \ No newline at end of file diff --git a/include/gp/functional/optional.hpp b/include/gp/functional/optional.hpp index 999bc21..ef2e0cd 100644 --- a/include/gp/functional/optional.hpp +++ b/include/gp/functional/optional.hpp @@ -3,6 +3,7 @@ #include "gp_config.hpp" #include "gp/functional/bind_front.hpp" +#include "gp/functional/monostates.hpp" #include "gp/algorithms/move.hpp" #include "gp/exception.hpp" @@ -10,9 +11,6 @@ #include namespace gp{ - struct nullopt_t final{}; - - constexpr nullopt_t nullopt; template class optional final{