C++11 range loop support for XmlNode, ValueArray, Value #1264

git-svn-id: svn://ultimatepp.org/upp/trunk@8920 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-09-13 19:01:52 +00:00
parent 555942682d
commit 02d258a434
6 changed files with 67 additions and 5 deletions

View file

@ -177,6 +177,8 @@ protected:
int PolyCompare(const Value& v) const;
Vector<Value>& CloneArray();
const Vector<Value>& GetVA() const;
#if defined(_DEBUG) && defined(COMPILER_GCC)
uint32 magic[4];
@ -274,6 +276,18 @@ public:
const Void *GetVoidPtr() const { ASSERT(IsRef()); return ptr(); }
friend void Swap(Value& a, Value& b) { Swap(a.data, b.data); }
typedef Vector<Value>::ConstIterator ConstIterator;
ConstIterator Begin() const;
ConstIterator End() const;
typedef Value value_type;
typedef ConstIterator const_iterator;
typedef const Value& const_reference;
typedef int size_type;
typedef int difference_type;
const_iterator begin() const { return Begin(); }
const_iterator end() const { return End(); }
};
struct ValueTypeError : Exc {