]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
Document wxKill(wxSIGTERM) reliance on having an open window in wxMSW.
[wxWidgets.git] / include / wx / list.h
index cb6bcbae62a60459b2ce2735998e619fb90ffaae..7a96c251525a8c685342a1072d7a3c0d5ff85c17 100644 (file)
@@ -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"
@@ -217,7 +218,7 @@ inline const void *wxListCastElementToVoidPtr(const wxString& str)
             }                                                                 \
             int IndexOf() const                                               \
             {                                                                 \
-                return *this ? std::distance( m_list->begin(), m_iter )       \
+                return *this ? (int)std::distance( m_list->begin(), m_iter )  \
                              : wxNOT_FOUND;                                   \
             }                                                                 \
         };                                                                    \
@@ -1215,6 +1216,23 @@ public:
     // compatibility methods
     void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
 #endif // !wxUSE_STD_CONTAINERS
+
+#ifndef __VISUALC6__
+    template<typename T>
+    wxVector<T> AsVector() const
+    {
+        wxVector<T> vector(size());
+        size_t i = 0;
+
+        for ( const_iterator it = begin(); it != end(); ++it )
+        {
+            vector[i++] = static_cast<T>(*it);
+        }
+
+        return vector;
+    }
+#endif // !__VISUALC6__
+
 };
 
 #if !wxUSE_STD_CONTAINERS