diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-27 11:32:16 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-27 11:32:16 +0000 |
commit | d82541fcea40efadaef63fef5f4a76c3fea5defe (patch) | |
tree | 4fcc8e8f73208c6cff60db59d5093817f0af40c0 /lib/glContainer.h | |
parent | Add text to framebuffer rendering test (diff) | |
download | ilt-d82541fcea40efadaef63fef5f4a76c3fea5defe.tar.bz2 ilt-d82541fcea40efadaef63fef5f4a76c3fea5defe.tar.xz ilt-d82541fcea40efadaef63fef5f4a76c3fea5defe.zip |
Support constructing a glContainer from a collection of the same type
Diffstat (limited to 'lib/glContainer.h')
-rw-r--r-- | lib/glContainer.h | 6 |
1 files changed, 6 insertions, 0 deletions
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<template<typename, typename...> typename C> explicit glContainer(const C<T> & src) + { + reserve(src.size()); + std::copy(src.begin(), src.end(), std::back_inserter(*this)); + } + DEFAULT_MOVE_NO_COPY(glContainer); [[nodiscard]] iterator |