From 324f0ceb60dc336ff13a2caa7b23cef33e125466 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 1 Apr 2014 19:26:50 +0000 Subject: [PATCH] Core: Fixed STL iterators for sorted maps git-svn-id: svn://ultimatepp.org/upp/trunk@7123 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/InVector.h | 4 ++-- uppsrc/Core/Topt.h | 16 ++++++++++++++++ uppsrc/Painter/init | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/uppsrc/Core/InVector.h b/uppsrc/Core/InVector.h index f914a8a7d..eae4dab62 100644 --- a/uppsrc/Core/InVector.h +++ b/uppsrc/Core/InVector.h @@ -652,7 +652,7 @@ public: ConstIterator End() const { return B::value.data.End(); } ConstIterator GetIter(int pos) const { return B::value.data.GetIter(pos); } - STL_MAP_COMPATIBILITY(SortedVectorMap) + STL_SORTED_MAP_COMPATIBILITY(SortedVectorMap) }; template @@ -729,6 +729,6 @@ public: ConstIterator End() const { return B::value.data.End(); } ConstIterator GetIter(int pos) const { return B::value.data.GetIter(pos); } - STL_MAP_COMPATIBILITY(SortedArrayMap) + STL_SORTED_MAP_COMPATIBILITY(SortedArrayMap) }; diff --git a/uppsrc/Core/Topt.h b/uppsrc/Core/Topt.h index daf728839..96d2b19bf 100644 --- a/uppsrc/Core/Topt.h +++ b/uppsrc/Core/Topt.h @@ -340,6 +340,22 @@ public: iterator begin() { return B::Begin(); } \ iterator end() { return B::End(); } \ +#define STL_SORTED_MAP_COMPATIBILITY(C) \ + typedef T value_type; \ + typedef ConstIterator const_iterator; \ + typedef const T& const_reference; \ + typedef int size_type; \ + typedef int difference_type; \ + const_iterator begin() const { return Begin(); } \ + const_iterator end() const { return End(); } \ + void clear() { B::Clear(); } \ + size_type size() const { return B::GetCount(); } \ + typedef Iterator iterator; \ + typedef T& reference; \ + bool empty() const { return B::GetCount() == 0; } \ + iterator begin() { return Begin(); } \ + iterator end() { return End(); } \ + #define STL_VECTOR_COMPATIBILITY(C) \ typedef T value_type; \ typedef ConstIterator const_iterator; \ diff --git a/uppsrc/Painter/init b/uppsrc/Painter/init index f401caed3..83d3403ae 100644 --- a/uppsrc/Painter/init +++ b/uppsrc/Painter/init @@ -1,7 +1,7 @@ #ifndef _Painter_icpp_init_stub #define _Painter_icpp_init_stub #include "Draw/init" -#define BLITZ_INDEX__ Fcf1e6c345d9100ecf96ca5bd96de6ce3 +#define BLITZ_INDEX__ Fb59219fc3bf1aed0b7289197596b0ec3 #include "PaintPainting.icpp" #undef BLITZ_INDEX__ #endif