X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a363af33bf35b1f3f8f4fd1142cf9dbb8fff9c09..7bd30a12ade503fd135c686ecc98a6f6d5fecbeb:/include/wx/dlist.h diff --git a/include/wx/dlist.h b/include/wx/dlist.h index 3e43cb8307..b69f617d9b 100644 --- a/include/wx/dlist.h +++ b/include/wx/dlist.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dlist.h +// Name: wx/dlist.h // Purpose: wxDList which is a template version of wxList // Author: Robert Roebling // Created: 18.09.2008 @@ -13,7 +13,7 @@ #include "wx/defs.h" #include "wx/utils.h" -#if wxUSE_STL +#if wxUSE_STD_CONTAINERS #include "wx/beforestd.h" #include @@ -199,7 +199,7 @@ public: } }; -#else // STL +#else // !wxUSE_STD_CONTAINERS template class wxDList @@ -789,13 +789,16 @@ public: for(size_type i = 0; i < n; ++i) Append(v); } - iterator insert(const iterator& it, const_reference v = value_type()) + iterator insert(const iterator& it, const_reference v) { - Insert(it.m_node,v); + if (it == end()) + Append( v ); + else + Insert(it.m_node,v); iterator itprev(it); return itprev--; } - void insert(const iterator& it, size_type n, const_reference v = value_type()) + void insert(const iterator& it, size_type n, const_reference v) { for(size_type i = 0; i < n; ++i) Insert(it.m_node, v); @@ -842,6 +845,6 @@ public: } */ }; -#endif // wxUSE_STL/!wxUSE_STL +#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS #endif // _WX_DLIST_H_