diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-11-03 12:44:36 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-11-08 08:09:29 -0800 |
commit | d1e2fe511ebf6d4aebbb08b2f0aba32e26c6edeb (patch) | |
tree | 6ca51ffe1a62f8e93af7fdff14b21e13e0e37b0f /src/mbgl/gl/uniform.hpp | |
parent | 1db2ffbc1b69069eca39f786cacc45dbb02c3052 (diff) | |
download | qtlocation-mapboxgl-d1e2fe511ebf6d4aebbb08b2f0aba32e26c6edeb.tar.gz |
[core] Introduce and use IndexedTuple
Diffstat (limited to 'src/mbgl/gl/uniform.hpp')
-rw-r--r-- | src/mbgl/gl/uniform.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/gl/uniform.hpp b/src/mbgl/gl/uniform.hpp index df4de0c75a..0b303e9d6f 100644 --- a/src/mbgl/gl/uniform.hpp +++ b/src/mbgl/gl/uniform.hpp @@ -3,10 +3,10 @@ #include <mbgl/gl/types.hpp> #include <mbgl/util/optional.hpp> #include <mbgl/util/ignore.hpp> +#include <mbgl/util/indexed_tuple.hpp> #include <array> #include <functional> -#include <tuple> namespace mbgl { namespace gl { @@ -63,8 +63,8 @@ UniformLocation uniformLocation(ProgramID, const char * name); template <class... Us> class Uniforms { public: - using State = std::tuple<typename Us::State...>; - using Values = std::tuple<typename Us::Value...>; + using State = IndexedTuple<TypeList<Us...>, TypeList<typename Us::State...>>; + using Values = IndexedTuple<TypeList<Us...>, TypeList<typename Us::Value...>>; static State state(const ProgramID& id) { return State { { uniformLocation(id, Us::name) }... }; @@ -72,7 +72,7 @@ public: static std::function<void ()> binder(State& state, Values&& values_) { return [&state, values = std::move(values_)] () mutable { - ignore((std::get<typename Us::State>(state) = std::get<typename Us::Value>(values), 0)...); + ignore({ (state.template get<Us>() = values.template get<Us>(), 0)... }); }; } }; |