forked from qt-creator/qt-creator
Variant: Prepare for C++17 support
Change-Id: I8f96ce3afae050d4e58e7fe9b70a92155045b71b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
2439cfcbdb
commit
c4071d09ad
@@ -30,10 +30,25 @@
|
||||
*/
|
||||
|
||||
// TODO: replace by #include <(experimental/)variant> depending on compiler and C++ version
|
||||
#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
|
||||
|
||||
#else
|
||||
#include <3rdparty/variant/variant.hpp>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
using namespace mpark;
|
||||
|
||||
using mpark::get;
|
||||
using mpark::get_if;
|
||||
using mpark::holds_alternative;
|
||||
using mpark::variant;
|
||||
} // namespace Utils
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user