Add ctor and assign() taking an iterator range to wxVector<>.

Do it for consistency with wxArray and std::vector<>, even if the current
implementation is suboptimal.

See #15216.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74045 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-05-22 14:13:26 +00:00
parent 41da7d974a
commit 4a8e979925
2 changed files with 45 additions and 0 deletions

View File

@@ -51,6 +51,19 @@ public:
*/
wxVector(size_type size, const value_type& value);
/**
Constructor initializing the vector with the elements in the given
range.
The @a InputIterator template parameter must be an input iterator type.
This constructor adds all elements from @a first until, not not
including, @a last to the vector.
@since 2.9.5
*/
template <class InputIterator>
wxVector(InputIterator first, InputIterator last);
/**
Copy constructor.
*/
@@ -70,6 +83,18 @@ public:
*/
void assign(size_type n, const value_type& v);
/**
Assigns the elements in the given range to the vector.
The @a InputIterator template parameter must be an input iterator type.
This method clears the vector and then adds all elements from @a first
until, not not including, @a last to it.
@since 2.9.5
*/
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
/**
Returns item at position @a idx.
*/