Get non-const object from VectorIterator (C++, flatbuffers 1.8.0)
I was wondering if there is a way to retrieve a non-const reference to an object from a VectorIterator object that is pointing to it. Looking at the code, doesn't seem like there is a way to get the non-const reference to an object.
template
struct IndirectHelper { typedef T return_type; typedef T mutable_return_type; static const size_t element_stride = sizeof(T); static return_type Read(const uint8_t *p, uoffset_t i) { return EndianScalar((reinterpret_cast<const T *>(p))[i]); } }; template<typename T, typename IT> struct VectorIterator { ... IT operator *() const { return IndirectHelper ::Read(data_, 0); } ... }
Even though mutable_return_type is declared in the IndirectHelper method, it is not used and in the end, we get the const object only upon indirection of the VectorIterator object. I couldn't find any other method in VectorIterator that can get me the non-const object. Am I missing something?
This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.
This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.