From: Vadim Zeitlin Date: Sun, 31 Aug 2008 14:15:05 +0000 (+0000) Subject: define wxString::iterator::iterator_category correctly if wxUSE_STD_STRING and not... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/302acc453d3fd2b80cfff4af2b8a49a39aaef677?ds=inline define wxString::iterator::iterator_category correctly if wxUSE_STD_STRING and not only if wxUSE_STL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/string.h b/include/wx/string.h index 08eafdc4b4..3f9214b00b 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -834,22 +834,26 @@ public: typedef size_t size_type; typedef wxUniChar const_reference; -#if wxUSE_STL +#if wxUSE_STD_STRING #if wxUSE_UNICODE_UTF8 // random access is not O(1), as required by Random Access Iterator #define WX_STR_ITERATOR_TAG std::bidirectional_iterator_tag #else #define WX_STR_ITERATOR_TAG std::random_access_iterator_tag #endif + #define WX_STR_ITERATOR_CATEGORY typedef WX_STR_ITERATOR_TAG iterator_category; #else - #define WX_STR_ITERATOR_TAG void /* dummy type */ + // not defining iterator_category at all in this case is better than defining + // it as some dummy type -- at least it results in more intelligible error + // messages + #define WX_STR_ITERATOR_CATEGORY #endif #define WX_STR_ITERATOR_IMPL(iterator_name, pointer_type, reference_type) \ private: \ typedef wxStringImpl::iterator_name underlying_iterator; \ public: \ - typedef WX_STR_ITERATOR_TAG iterator_category; \ + WX_STR_ITERATOR_CATEGORY \ typedef wxUniChar value_type; \ typedef int difference_type; \ typedef reference_type reference; \