HomePhabricator

[STLExtras] Use return type from operator* of the wrapped iter.

Authored by fhahn on Sun, Jan 10, 6:41 AM.

Description

[STLExtras] Use return type from operator* of the wrapped iter.

Currently make_early_inc_range cannot be used with iterators with
operator* implementations that do not return a reference.

Most notably in the LLVM codebase, this means the User iterator ranges
cannot be used with make_early_inc_range, which slightly simplifies
iterating over ranges while elements are removed.

Instead of directly using BaseT::reference as return type of operator*,
this patch uses decltype to get the actual return type of the operator*
implementation in WrappedIteratorT.

This patch also updates a few places to use make use of
make_early_inc_range.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D93992

Details

Committed
fhahnSun, Jan 10, 6:41 AM
Reviewer
dblaikie
Differential Revision
D93992: [STLExtras] Use return type from operator* of the wrapped iter.
Parents
rG47991a15d192: [lld/mac] llvm style fix: no else after return
Branches
Unknown
Tags
Unknown