Files
devilutionX/Source/utils/stdcompat/optional.hpp
T
Gleb Mazovetskiy 21dc7f553d Add OptionalCelSprite: smaller than std::optional
`CelSprite` data pointer can never be `nullptr`.

We implement a smaller `optional` for it by taking advantage of that.
2022-07-03 12:26:39 +01:00

17 lines
545 B
C++

#pragma once
#ifdef __has_include
#if defined(__cplusplus) && (__cplusplus >= 201606L || _MSC_VER >= 1930) && __has_include(<optional>)
#include <optional> // IWYU pragma: export
#elif __has_include(<experimental/optional>)
#include <experimental/optional> // IWYU pragma: export
#define optional experimental::optional
#define nullopt experimental::nullopt
#define nullopt_t experimental::nullopt_t
#else
#error "Missing support for <optional> or <experimental/optional>"
#endif
#else
#error "__has_include unavailable"
#endif