From 63a38412aafb87dc606fe7da5203689dac25a3ad Mon Sep 17 00:00:00 2001 From: Tom Lankhorst Date: Mon, 18 Feb 2019 23:42:13 +0100 Subject: [PATCH] Add `optional` header --- src/openrct2/core/Optional.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/openrct2/core/Optional.hpp diff --git a/src/openrct2/core/Optional.hpp b/src/openrct2/core/Optional.hpp new file mode 100644 index 0000000000..66c67028fb --- /dev/null +++ b/src/openrct2/core/Optional.hpp @@ -0,0 +1,29 @@ +/***************************************************************************** + * Copyright (c) 2014-2019 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#ifdef __has_include +# if __has_include() +# include +# elif __has_include() +# include +# else +# error Missing +# endif +#else +# error __has_include is not defined +#endif + +// `optional` and friends will be available in NS `::opt` +#if __has_include() +namespace opt = std; +#elif __has_include() +namespace opt = std::experimental; +#endif