diff --git a/include/stx/optional.hpp b/include/stx/optional.hpp index 3f8c556..132e33a 100644 --- a/include/stx/optional.hpp +++ b/include/stx/optional.hpp @@ -37,8 +37,11 @@ using std::nullopt_t; using std::nullopt; using std::make_optional; +# ifndef STX_HAVE_IN_PLACE_T using std::in_place_t; using std::in_place; +# define STX_HAVE_IN_PLACE_T 1 +# endif // STX_HAVE_IN_PLACE_T } # define STX_HAVE_STD_OPTIONAL 1 # elif __has_include() @@ -49,8 +52,11 @@ using std::experimental::nullopt_t; using std::experimental::nullopt; using std::experimental::make_optional; +# ifndef STX_HAVE_IN_PLACE_T using std::experimental::in_place_t; using std::experimental::in_place; +# define STX_HAVE_IN_PLACE_T 1 +# endif // STX_HAVE_IN_PLACE_T } # define STX_HAVE_STD_OPTIONAL 1 # endif // __hasinclude(optional) @@ -299,24 +305,6 @@ struct in_place_t { constexpr in_place_t in_place{}; -template struct in_place_type_t { - explicit in_place_type_t() = default; -}; - - -template struct in_place_index_t { - explicit in_place_index_t() = default; -}; - - -#if __cpp_variable_templates >= 201304 -template -constexpr in_place_type_t in_place_type{}; -template -constexpr in_place_index_t in_place_index{}; -#endif // __cpp_variable_templates - - #define STX_HAVE_IN_PLACE_T #endif // STX_HAVE_IN_PLACE_T diff --git a/include/stx/variant.hpp b/include/stx/variant.hpp index dbf79e6..4d6d41c 100644 --- a/include/stx/variant.hpp +++ b/include/stx/variant.hpp @@ -57,7 +57,7 @@ # ifndef STX_HAVE_IN_PLACE_T using std::in_place_t; using std::in_place; -# define STX_IN_PLACE_T 1 +# define STX_HAVE_IN_PLACE_T 1 # endif using std::in_place_type_t; using std::in_place_type;