mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
a0b8b8f5e2
1. we have overloaded operator*() for all iterators, returning a value type T (not a reference). 2. we use the std::reverse_iterator, its operator*() returns a reference type, by default the reference type is T&. follow implement std::reverse_iterator::operator*() const are taken form VS2015: ```C++ // in class reverse_iterator reference operator*() const { // return designated value _RanIt _Tmp = current; return (*--_Tmp); } ``` The `_RanIt` is our base non reverse iterators, the type of `(*--_Tmp)` is `T`. and the `reference` is `T&`. This cause > warning C4172: returning address of local variable or temporary And it is bug. This commit specifies explicitly the 5th template argument for all our iterators base class like `std::iterator<tag,T, ptrdiff_t, T*, T>`. It make the `reference` to be actually `T` (the value type) and fixes the issue. |
||
---|---|---|
.. | ||
xlnt |