Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Put ignore in util namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Nov 4, 2016
1 parent 8ad7736 commit 7505640
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/mbgl/gl/attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ class Attributes {

static std::function<void (std::size_t)> binder(const State& state) {
return [&state] (std::size_t vertexOffset) {
ignore({ (bindAttribute(state.template get<As>().location,
state.template get<As>().count,
state.template get<As>().type,
sizeof(Vertex),
vertexOffset,
Vertex::attributeOffsets[Index<As>]), 0)... });
util::ignore({ (bindAttribute(state.template get<As>().location,
state.template get<As>().count,
state.template get<As>().type,
sizeof(Vertex),
vertexOffset,
Vertex::attributeOffsets[Index<As>]), 0)... });
};
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/gl/index_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class IndexVector {
template <class... Args>
void emplace_back(Args&&... args) {
static_assert(sizeof...(args) == groupSize, "wrong buffer element count");
ignore({(v.emplace_back(std::forward<Args>(args)), 0)...});
util::ignore({(v.emplace_back(std::forward<Args>(args)), 0)...});
}

std::size_t indexSize() const { return v.size(); }
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/gl/uniform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Uniforms {

static std::function<void ()> binder(State& state, Values&& values_) {
return [&state, values = std::move(values_)] () mutable {
ignore({ (state.template get<Us>() = values.template get<Us>(), 0)... });
util::ignore({ (state.template get<Us>() = values.template get<Us>(), 0)... });
};
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/gl/vertex_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class VertexVector {
template <class... Args>
void emplace_back(Args&&... args) {
static_assert(sizeof...(args) == groupSize, "wrong buffer element count");
ignore({(v.emplace_back(std::forward<Args>(args)), 0)...});
util::ignore({(v.emplace_back(std::forward<Args>(args)), 0)...});
}

std::size_t vertexSize() const { return v.size(); }
Expand Down
2 changes: 2 additions & 0 deletions src/mbgl/util/ignore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <initializer_list>

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
Expand All @@ -18,4 +19,5 @@ template <class... Ts> void ignore(Ts&&...) {}
//
template <class T> void ignore(const std::initializer_list<T>&) {}

} // namespace util
} // namespace mbgl

0 comments on commit 7505640

Please sign in to comment.