X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7ef20685fb2a98f963aeae040c8bd4961f32ff7..661698e54f2bc599dc1a961ffbae08ccdd6b9b97:/include/wx/vector.h diff --git a/include/wx/vector.h b/include/wx/vector.h index e33f523d1c..dffb19fc9d 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -255,6 +255,13 @@ public: Copy(c); } + template + wxVector(InputIterator first, InputIterator last) + : m_size(0), m_capacity(0), m_values(NULL) + { + assign(first, last); + } + ~wxVector() { clear(); @@ -268,6 +275,19 @@ public: push_back(v); } + template + void assign(InputIterator first, InputIterator last) + { + clear(); + + // Notice that it would be nice to call reserve() here but we can't do + // it for arbitrary input iterators, we should have a dispatch on + // iterator type and call it if possible. + + for ( InputIterator it = first; it != last; ++it ) + push_back(*it); + } + void swap(wxVector& v) { wxSwap(m_size, v.m_size);