From 7505640cb1abb0c8f239e2ad66e3654a15584fc5 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 4 Nov 2016 14:38:05 -0700 Subject: [PATCH] [core] Put ignore in util namespace --- src/mbgl/gl/attribute.hpp | 12 ++++++------ src/mbgl/gl/index_buffer.hpp | 2 +- src/mbgl/gl/uniform.hpp | 2 +- src/mbgl/gl/vertex_buffer.hpp | 2 +- src/mbgl/util/ignore.hpp | 2 ++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/mbgl/gl/attribute.hpp b/src/mbgl/gl/attribute.hpp index 47f93f31f99..df469fc6a2f 100644 --- a/src/mbgl/gl/attribute.hpp +++ b/src/mbgl/gl/attribute.hpp @@ -154,12 +154,12 @@ class Attributes { static std::function binder(const State& state) { return [&state] (std::size_t vertexOffset) { - ignore({ (bindAttribute(state.template get().location, - state.template get().count, - state.template get().type, - sizeof(Vertex), - vertexOffset, - Vertex::attributeOffsets[Index]), 0)... }); + util::ignore({ (bindAttribute(state.template get().location, + state.template get().count, + state.template get().type, + sizeof(Vertex), + vertexOffset, + Vertex::attributeOffsets[Index]), 0)... }); }; } }; diff --git a/src/mbgl/gl/index_buffer.hpp b/src/mbgl/gl/index_buffer.hpp index 8b40bf68c39..b3610f41547 100644 --- a/src/mbgl/gl/index_buffer.hpp +++ b/src/mbgl/gl/index_buffer.hpp @@ -17,7 +17,7 @@ class IndexVector { template void emplace_back(Args&&... args) { static_assert(sizeof...(args) == groupSize, "wrong buffer element count"); - ignore({(v.emplace_back(std::forward(args)), 0)...}); + util::ignore({(v.emplace_back(std::forward(args)), 0)...}); } std::size_t indexSize() const { return v.size(); } diff --git a/src/mbgl/gl/uniform.hpp b/src/mbgl/gl/uniform.hpp index d0d6be11fde..21814089885 100644 --- a/src/mbgl/gl/uniform.hpp +++ b/src/mbgl/gl/uniform.hpp @@ -74,7 +74,7 @@ class Uniforms { static std::function binder(State& state, Values&& values_) { return [&state, values = std::move(values_)] () mutable { - ignore({ (state.template get() = values.template get(), 0)... }); + util::ignore({ (state.template get() = values.template get(), 0)... }); }; } }; diff --git a/src/mbgl/gl/vertex_buffer.hpp b/src/mbgl/gl/vertex_buffer.hpp index 9d5532beabe..c9bc01f3e89 100644 --- a/src/mbgl/gl/vertex_buffer.hpp +++ b/src/mbgl/gl/vertex_buffer.hpp @@ -19,7 +19,7 @@ class VertexVector { template void emplace_back(Args&&... args) { static_assert(sizeof...(args) == groupSize, "wrong buffer element count"); - ignore({(v.emplace_back(std::forward(args)), 0)...}); + util::ignore({(v.emplace_back(std::forward(args)), 0)...}); } std::size_t vertexSize() const { return v.size(); } diff --git a/src/mbgl/util/ignore.hpp b/src/mbgl/util/ignore.hpp index 31cd092c0ef..955b1de2fae 100644 --- a/src/mbgl/util/ignore.hpp +++ b/src/mbgl/util/ignore.hpp @@ -3,6 +3,7 @@ #include namespace mbgl { +namespace util { // Accept any number of parameters of any types, and do nothing with them. // Useful for providing a context for parameter pack expansion where a legal @@ -18,4 +19,5 @@ template void ignore(Ts&&...) {} // template void ignore(const std::initializer_list&) {} +} // namespace util } // namespace mbgl