X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1bc5ddea1595206819d75bc61f57c47e534ee46f..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/include/wx/list.h diff --git a/include/wx/list.h b/include/wx/list.h index cb6bcbae62..ed34130a16 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -32,6 +32,7 @@ #include "wx/defs.h" #include "wx/object.h" #include "wx/string.h" +#include "wx/vector.h" #if wxUSE_STD_CONTAINERS #include "wx/beforestd.h" @@ -1215,6 +1216,23 @@ public: // compatibility methods void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); } #endif // !wxUSE_STD_CONTAINERS + +#ifndef __VISUALC6__ + template + wxVector AsVector() const + { + wxVector vector(size()); + size_t i = 0; + + for ( const_iterator it = begin(); it != end(); ++it ) + { + vector[i++] = static_cast(*it); + } + + return vector; + } +#endif // !__VISUALC6__ + }; #if !wxUSE_STD_CONTAINERS