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
This commit is contained in:
@@ -834,22 +834,26 @@ public:
|
|||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
typedef wxUniChar const_reference;
|
typedef wxUniChar const_reference;
|
||||||
|
|
||||||
#if wxUSE_STL
|
#if wxUSE_STD_STRING
|
||||||
#if wxUSE_UNICODE_UTF8
|
#if wxUSE_UNICODE_UTF8
|
||||||
// random access is not O(1), as required by Random Access Iterator
|
// random access is not O(1), as required by Random Access Iterator
|
||||||
#define WX_STR_ITERATOR_TAG std::bidirectional_iterator_tag
|
#define WX_STR_ITERATOR_TAG std::bidirectional_iterator_tag
|
||||||
#else
|
#else
|
||||||
#define WX_STR_ITERATOR_TAG std::random_access_iterator_tag
|
#define WX_STR_ITERATOR_TAG std::random_access_iterator_tag
|
||||||
#endif
|
#endif
|
||||||
|
#define WX_STR_ITERATOR_CATEGORY typedef WX_STR_ITERATOR_TAG iterator_category;
|
||||||
#else
|
#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
|
#endif
|
||||||
|
|
||||||
#define WX_STR_ITERATOR_IMPL(iterator_name, pointer_type, reference_type) \
|
#define WX_STR_ITERATOR_IMPL(iterator_name, pointer_type, reference_type) \
|
||||||
private: \
|
private: \
|
||||||
typedef wxStringImpl::iterator_name underlying_iterator; \
|
typedef wxStringImpl::iterator_name underlying_iterator; \
|
||||||
public: \
|
public: \
|
||||||
typedef WX_STR_ITERATOR_TAG iterator_category; \
|
WX_STR_ITERATOR_CATEGORY \
|
||||||
typedef wxUniChar value_type; \
|
typedef wxUniChar value_type; \
|
||||||
typedef int difference_type; \
|
typedef int difference_type; \
|
||||||
typedef reference_type reference; \
|
typedef reference_type reference; \
|
||||||
|
Reference in New Issue
Block a user