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{