diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-07-23 14:10:43 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-07-23 16:55:25 +0300 |
commit | cafecd3f6fedc16e7bf5dff699960978c3b5cb3d (patch) | |
tree | 978359e9f49b242333b87c2ef0f83c51d6b67983 /src/mbgl/gfx | |
parent | d7dd35220932726e23bb3d353b32b65bf50bc198 (diff) | |
download | qtlocation-mapboxgl-cafecd3f6fedc16e7bf5dff699960978c3b5cb3d.tar.gz |
[core] Introduce VertexVector::extend() and use it in placement code.
Diffstat (limited to 'src/mbgl/gfx')
-rw-r--r-- | src/mbgl/gfx/vertex_vector.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
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 V> class VertexVector { public: using Vertex = V; + template<typename Arg> + void emplace_back(Arg&& vertex) { + v.emplace_back(std::forward<Arg>(vertex)); + } - template <class... Args> - void emplace_back(Args&&... args) { - static_assert(sizeof...(args) == 1, "wrong buffer element count"); - util::ignore({ (v.emplace_back(std::forward<Args>(args)), 0)... }); + void extend(std::size_t n, const Vertex& val) { + v.resize(v.size() + n, val); } std::size_t elements() const { |