[ADT] Rewrite mapped_iterator in terms of iterator_adaptor_base.
authorLang Hames <lhames@gmail.com>
Fri, 10 Nov 2017 17:41:28 +0000 (17:41 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 10 Nov 2017 17:41:28 +0000 (17:41 +0000)
commit43e7b7a57f7922284ff8778eefffea143ece7155
treee633b2979f2e65ed85aad8945684350e40463502
parent028d815e2847d7056b37eb938b5fdaca7aa3636e
[ADT] Rewrite mapped_iterator in terms of iterator_adaptor_base.

Summary:
This eliminates the boilerplate implementation of the iterator interface in
mapped_iterator.

This patch also adds unit tests that verify that the mapped function is applied
by operator* and operator->, and that references returned by the map function
are returned via operator*.

Reviewers: dblaikie, chandlerc

Subscribers: llvm-commits, mgorny

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

llvm-svn: 317902
llvm/include/llvm/ADT/STLExtras.h
llvm/unittests/ADT/CMakeLists.txt
llvm/unittests/ADT/MappedIteratorTest.cpp [new file with mode: 0644]