diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index f1fa850..250c33e 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -919,9 +919,16 @@ int z = a[0u].GetInt(); // This works too. const GenericValue& operator[](SizeType index) const { return const_cast(*this)[index]; } //! Element iterator + /*! \pre IsArray() == true */ ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements; } + //! \em Past-the-end element iterator + /*! \pre IsArray() == true */ ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements + data_.a.size; } + //! Constant element iterator + /*! \pre IsArray() == true */ ConstValueIterator Begin() const { return const_cast(*this).Begin(); } + //! Constant \em past-the-end element iterator + /*! \pre IsArray() == true */ ConstValueIterator End() const { return const_cast(*this).End(); } //! Request the array to have enough capacity to store elements.