This is an archive of the discontinued LLVM Phabricator instance.

allow lambdas in mapped_iterator
ClosedPublic

Authored by aizatsky on Feb 16 2016, 4:30 PM.

Details

Summary

::result_type is undefined for lambdas, but we now have decltype!

Diff Detail

Repository
rL LLVM

Event Timeline

aizatsky updated this revision to Diff 48125.Feb 16 2016, 4:30 PM
aizatsky retitled this revision from to allow lambdas in mapped_iterator.
aizatsky updated this object.
aizatsky updated this object.Feb 16 2016, 4:34 PM
aizatsky added reviewers: sanjoy, pcc, dblaikie.
aizatsky added a subscriber: llvm-commits.
sanjoy resigned from this revision.Mar 11 2016, 5:13 PM
sanjoy removed a reviewer: sanjoy.

This looks okay to me, but I don't know enough C++ to have an idea of the corner cases here.

dblaikie edited edge metadata.Mar 11 2016, 5:25 PM

Got a test/usage example?

aizatsky updated this revision to Diff 50884.Mar 16 2016, 3:26 PM
aizatsky edited edge metadata.

added unittest.

I have added the unittest for map_iterator. My final goal is to move map_range somewhere, but I was planning to do it in next CL.

dblaikie accepted this revision.Mar 17 2016, 2:05 PM
dblaikie edited edge metadata.

Looks good to me - thanks!

(I'd probably just include one of those two tests - not like the test new/unique/separate codepaths really, but I'm not too fussed)

This revision is now accepted and ready to land.Mar 17 2016, 2:05 PM
This revision was automatically updated to reflect the committed changes.

I had to roll it back because of MSVC:

C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include\llvm/ADT/STLExtras.h(120): error C2100: illegal indirection
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include\llvm/IR/Instructions.h(3966): note: see reference to class template instantiation 'llvm::mapped_iterator<llvm::User::op_iterator,llvm::CatchSwitchInst::DerefFnTy>' being compiled