[core] Put ignore in util namespace

This commit is contained in:
John Firebaugh
2016-11-04 14:38:05 -07:00
parent d1e2fe511e
commit 52be5d480d
5 changed files with 11 additions and 9 deletions

View File

@@ -154,12 +154,12 @@ public:
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)... });
};
}
};

View File

@@ -17,7 +17,7 @@ public:
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(); }

View File

@@ -72,7 +72,7 @@ public:
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)... });
};
}
};

View File

@@ -19,7 +19,7 @@ public:
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(); }

View File

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