From 795ac80edb77f72619c4a683c4ece79726ac6e8b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Jul 2009 08:56:31 +0000 Subject: [PATCH] make wxSortedArrayString::Sort() and Insert() private in STL build (closes #10947) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/arrstr.h | 11 +++++++++++ interface/wx/arrstr.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/include/wx/arrstr.h b/include/wx/arrstr.h index a9e6f86f04..9e6ec1a392 100644 --- a/include/wx/arrstr.h +++ b/include/wx/arrstr.h @@ -87,6 +87,17 @@ public: } int Index(const wxString& str, bool bCase = true, bool bFromEnd = false) const; + +private: + void Insert() + { + wxFAIL_MSG( "wxSortedArrayString::Insert() is not to be used" ); + } + + void Sort() + { + wxFAIL_MSG( "wxSortedArrayString::Sort() is not to be used" ); + } }; #else // if !wxUSE_STL diff --git a/interface/wx/arrstr.h b/interface/wx/arrstr.h index dab15fa275..a1135bbaa2 100644 --- a/interface/wx/arrstr.h +++ b/interface/wx/arrstr.h @@ -310,6 +310,8 @@ public: @warning This function should not be used with sorted arrays because it could break the order of items and, for example, subsequent calls to Index() would then not work! + + @warning In STL mode, Insert is private and simply invokes wxFAIL_MSG. */ void Insert(const wxString& str, size_t nIndex, size_t copies = 1); @@ -320,6 +322,8 @@ public: break the order of items and, for example, subsequent calls to Index() would then not work! Also, sorting a wxSortedArrayString doesn't make sense because its elements are always already sorted. + + @warning In STL mode, Sort is private and simply invokes wxFAIL_MSG. */ void Sort(bool reverseOrder = false); void Sort(CompareFunction compareFunction); -- 2.45.2