diff --git a/include/mbgl/util/indexed_tuple.hpp b/include/mbgl/util/indexed_tuple.hpp index fd0b931d3..ea4fe7462 100644 --- a/include/mbgl/util/indexed_tuple.hpp +++ b/include/mbgl/util/indexed_tuple.hpp @@ -1,9 +1,9 @@ #pragma once #include +#include #include -#include namespace mbgl { @@ -24,20 +24,20 @@ template class IndexedTuple; // for motivation. // template -class IndexedTuple, TypeList> : public std::tuple { +class IndexedTuple, TypeList> : public tuple_polyfill { public: static_assert(sizeof...(Is) == sizeof...(Ts), "IndexedTuple size mismatch"); - using std::tuple::tuple; + using tuple_polyfill::tuple; template auto& get() { - return std::get::value>(*this); + return get_polyfill::value>(*this); } template const auto& get() const { - return std::get::value>(*this); + return get_polyfill::value>(*this); } template diff --git a/include/mbgl/util/tuple.hpp b/include/mbgl/util/tuple.hpp new file mode 100644 index 000000000..3f6e80a8c --- /dev/null +++ b/include/mbgl/util/tuple.hpp @@ -0,0 +1,19 @@ +#pragma once + +// Polyfill needed by Windows because MSVC STL +// is not compatible with our IndexedTuple code +#if defined(_WINDOWS) + +#include + +#define get_polyfill tao::get +#define tuple_polyfill tao::tuple + +#else + +#include + +#define get_polyfill std::get +#define tuple_polyfill std::tuple + +#endif