[C++]Support reverse iterator in Vector (#5128)
authorHenry Lee <lee0906@hotmail.com>
Thu, 24 Jan 2019 21:24:01 +0000 (08:24 +1100)
committerWouter van Oortmerssen <aardappel@gmail.com>
Thu, 24 Jan 2019 21:24:01 +0000 (13:24 -0800)
commitc2f40c37b2c0cf2c7fbb82b4b760276771abe7a1
tree930e2c3d1ab6e90061f8d47665e778d6d85b0280
parent63d51afd1196336a7d1f56a988091ef05deb1c62
[C++]Support reverse iterator in Vector (#5128)

* Add `const` keyword to the `operator-(const uoffset_t &)` function in
`VectorIterator`

* Support reverse iterator in Vector

Introduced a new VectorReverseIterator type. We cannot directly use
`std::reverse_iterator<VectorIterator>` because the signature of
`operator*` and `operator->` in the VectorIterator class are not
standard signatures.

Also added `rbegin()`, `rend()`, `cbegin()`, `cend()`, `crbegin()`
and `crend()` in the Vector class.
include/flatbuffers/flatbuffers.h
tests/test.cpp