summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/coretmpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/coretmpl.h')
-rw-r--r--src/lib/util/coretmpl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h
index e798f0dd7c9..55faa0fde0c 100644
--- a/src/lib/util/coretmpl.h
+++ b/src/lib/util/coretmpl.h
@@ -99,6 +99,14 @@ public:
void resize_and_clear(int count, UINT8 data = 0) { resize(count); clear(data); }
void resize_keep_and_clear_new(int count, UINT8 data = 0) { int oldcount = m_count; resize_keep(count); if (oldcount < m_count) clear_internal(oldcount, m_count - oldcount, data); }
+ // batch operations
+ void copyfrom(const dynamic_array<_ElementType> &source)
+ {
+ resize(source.count());
+ for (int i=0; i < source.count(); i++)
+ m_array[i] = source[i];
+ }
+
private:
// internal helpers
void expand_internal(int count)