From d82541fcea40efadaef63fef5f4a76c3fea5defe Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 27 Jan 2024 11:32:16 +0000 Subject: Support constructing a glContainer from a collection of the same type --- lib/glContainer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/glContainer.h b/lib/glContainer.h index ce88916..2ccc1c2 100644 --- a/lib/glContainer.h +++ b/lib/glContainer.h @@ -38,6 +38,12 @@ public: clear(); } + template typename C> explicit glContainer(const C & src) + { + reserve(src.size()); + std::copy(src.begin(), src.end(), std::back_inserter(*this)); + } + DEFAULT_MOVE_NO_COPY(glContainer); [[nodiscard]] iterator -- cgit v1.2.3