diff options
Diffstat (limited to 'src/libs/utils/variant.h')
-rw-r--r-- | src/libs/utils/variant.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/libs/utils/variant.h b/src/libs/utils/variant.h index 00e9eaf252..371b9312d3 100644 --- a/src/libs/utils/variant.h +++ b/src/libs/utils/variant.h @@ -30,10 +30,25 @@ */ // TODO: replace by #include <(experimental/)variant> depending on compiler and C++ version -#include <3rdparty/variant/variant.hpp> +#if __cplusplus >= 201703L +#error Please delete variant.hpp and the #else section below, then remove this error +#include <variant> namespace Utils { +using std::get; +using std::get_if; +using std::holds_alternative; +using std::variant; +} // namespace Utils -using namespace mpark; +#else +#include <3rdparty/variant/variant.hpp> +namespace Utils { +using mpark::get; +using mpark::get_if; +using mpark::holds_alternative; +using mpark::variant; } // namespace Utils + +#endif |