From cafecd3f6fedc16e7bf5dff699960978c3b5cb3d Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Tue, 23 Jul 2019 14:10:43 +0300 Subject: [core] Introduce VertexVector::extend() and use it in placement code. --- src/mbgl/gfx/vertex_vector.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mbgl/gfx/vertex_vector.hpp') diff --git a/src/mbgl/gfx/vertex_vector.hpp b/src/mbgl/gfx/vertex_vector.hpp index f41f842294..59fe67586b 100644 --- a/src/mbgl/gfx/vertex_vector.hpp +++ b/src/mbgl/gfx/vertex_vector.hpp @@ -11,11 +11,13 @@ template class VertexVector { public: using Vertex = V; + template + void emplace_back(Arg&& vertex) { + v.emplace_back(std::forward(vertex)); + } - template - void emplace_back(Args&&... args) { - static_assert(sizeof...(args) == 1, "wrong buffer element count"); - util::ignore({ (v.emplace_back(std::forward(args)), 0)... }); + void extend(std::size_t n, const Vertex& val) { + v.resize(v.size() + n, val); } std::size_t elements() const { -- cgit v1.2.1