summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/STLExtrasTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename llvm::apply -> llvm::apply_tuple.Zachary Turner2016-10-101-3/+3
| | | | | | | | | | | llvm::cl already has a function called llvm::apply() so this is causing an ODR violation. The STLExtras version should win the vote on which one gets to be called apply() since it is named after the equivalent STL function, but since renaiming the cl version is more difficult, let's do this for now to get the bots green. llvm-svn: 283800
* Add llvm::apply to STLExtras.Zachary Turner2016-10-101-0/+45
| | | | | | | | | This is equivalent to the C++14 std::apply(). Since we are not using C++14 yet, this allows us to still make use of apply anyway. Differential revision: https://reviews.llvm.org/D25100 llvm-svn: 283779
* Remove extra semicolonReid Kleckner2016-10-051-1/+1
| | | | llvm-svn: 283395
* Fix the build with MSVC 2013, still cannot default move ctors yetReid Kleckner2016-10-051-1/+2
| | | | | | Ten days. llvm-svn: 283394
* Fix build due to comparison of std::pairs.Zachary Turner2016-10-051-16/+20
| | | | llvm-svn: 283342
* Add llvm::enumerate() range adapter.Zachary Turner2016-10-051-27/+128
| | | | | | | | | This allows you to enumerate over a range using a range-based for while the return type contains the index of the enumeration. Differential revision: https://reviews.llvm.org/D25124 llvm-svn: 283337
* Resubmit "Add llvm::enumerate() to STLExtras."Zachary Turner2016-09-301-0/+49
| | | | | | | | The CL was originally failing due to the use of some C++14 specific features, so I've removed those. Hopefully this will satisfy the bots. llvm-svn: 282867
* Revert "Add llvm::enumerate() to STLExtras."Zachary Turner2016-09-291-49/+0
| | | | | | | This reverts commit r282804 as it seems to use some C++ features that not all compilers support. llvm-svn: 282809
* Add llvm::enumerate() to STLExtras.Zachary Turner2016-09-291-0/+49
| | | | | | | | | enumerate allows you to iterate over a range by pairing the iterator's value with its index in the enumeration. This gives you most of the benefits of using a for loop while still allowing the range syntax. llvm-svn: 282804
* [ADT] Add the worlds simplest STL extra. Or at least close to it.Chandler Carruth2016-08-191-0/+40
This is a little class template that just builds an inheritance chain of empty classes. Despite how simple this is, it can be used to really nicely create ranked overload sets. I've added a unittest as much to document this as test it. You can pass an object of this type as an argument to a function overload set an it will call the first viable and enabled candidate at or below the rank of the object. I'm planning to use this in a subsequent commit to more clearly rank overload candidates used for SFINAE. All credit for this technique and both lines of code here to Richard Smith who was helping me rewrite the SFINAE check in question to much more effectively capture the intended set of checks. llvm-svn: 279197
OpenPOWER on IntegriCloud