This change is to provide FuncReturnTy as a reference type to iterator_adaptor_base class. It fixes a compilation error when
mapped_iterator is wrapped into another iterator object (e.g. reverse_iterator) and its operator*() tries to return a reference type.
Actually mapped_iterator could not provide a references to the values it iterates on, which leads to the compilation error.
Example 1:
std::vector<int> V; auto It = map_iterator(V.begin(), [](int) { return 0; }); decltype(It)::reference R = *It; // error C2440: 'initializing': cannot convert // from 'FuncReturnTy' to 'int &' with FuncReturnTy=int
Example 2:
std::vector<int> V; auto R1 = map_range(V, [](int) { return 0; }); auto R2 = reverse(R1); *R1.begin(); // OK *R2.begin(); // error C2440: 'return': cannot convert from // 'FuncReturnTy' to 'int &' with FuncReturnTy=int