mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-15 10:21:10 -04:00
Use experimental/optional if available
This commit is contained in:
parent
e8c0218fe4
commit
74bff27f86
@ -22,6 +22,25 @@
|
||||
#ifndef SDL2PP_OPTIONAL_HH
|
||||
#define SDL2PP_OPTIONAL_HH
|
||||
|
||||
#include <SDL2pp/Config.hh>
|
||||
|
||||
#if defined(SDL2PP_WITH_EXPERIMENTAL_OPTIONAL)
|
||||
|
||||
#include <experimental/optional>
|
||||
|
||||
namespace SDL2pp {
|
||||
|
||||
template<typename T>
|
||||
using Optional = std::experimental::optional<T>;
|
||||
|
||||
using BadOptionalAccess = std::experimental::bad_optional_access;
|
||||
|
||||
constexpr std::experimental::nullopt_t NullOpt = std::experimental::nullopt;
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <SDL2pp/external/libcpp_optional.hh>
|
||||
|
||||
namespace SDL2pp {
|
||||
@ -36,3 +55,5 @@ constexpr sdl2pp_libcpp_optional::nullopt_t NullOpt = sdl2pp_libcpp_optional::nu
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user