summaryrefslogtreecommitdiffstats
path: root/libcxx/include/algorithm
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect type usage; nice catch by SebastianMarshall Clow2013-05-101-1/+1
| | | | llvm-svn: 181569
* Implement n3607: 'equal', 'mismatch', and 'is_permutation'Marshall Clow2013-05-091-0/+207
| | | | llvm-svn: 181548
* Somehow search_n never got tested, so of course it had a bug in it. This ↵Howard Hinnant2013-04-041-1/+1
| | | | | | fixes http://llvm.org/bugs/show_bug.cgi?id=15667. llvm-svn: 178764
* Change the 'result_type' from unsigned to 'uint_fast32_t'. This eliminates ↵Marshall Clow2013-02-071-1/+1
| | | | | | truncation warnings on Linux llvm-svn: 174669
* Marcin Zalewski: Change the name of a template parameter in __copy_backward ↵Howard Hinnant2013-02-061-2/+2
| | | | | | from _InputIterator to _BidirectionalIterator to better document the intent of the algorithm. llvm-svn: 174544
* Provide a way to disable use of extern templates in libc++. This is ↵Howard Hinnant2012-11-061-33/+33
| | | | | | intended for the clients of libc++, not the libc++ build. The dylib should always contain the extern templates. To disable the client needs to put -D'_LIBCPP_EXTERN_TEMPLATE(...)=' on the command line. llvm-svn: 167486
* Performance tweaking rotate.Howard Hinnant2012-08-031-27/+84
| | | | | | | | | | | | | | | | | | | | | | rotate is a critical algorithm because it is often used by other algorithms, both std and non-std. The main thrust of this optimization is a specialized algorithm when the 'distance' to be shifted is 1 (either left or right). To my surprise, this 'optimization' was not effective for types like std::string. std::string favors rotate algorithms which only use swap. But for types like scalars, and especially when the sequence is random access, these new specializations are a big win. If it is a vector<size_t> for example, the rotate is done via a memmove and can be several times faster than the gcd algorithm. I'm using is_trivially_move_assignable to distinguish between types like int and types like string. This is obviously an ad-hoc approximation, but I haven't found a case where it doesn't give good results. I've used a 'static if' (with is_trivially_move_assignable) in three places. Testing with both -Os and -O3 showed that clang eliminated all code not be executed by the 'static if' (including the 'static if' itself). llvm-svn: 161247
* <algorithm> no longer needs to include <cstdlib>, but can get away with just ↵Howard Hinnant2012-07-261-1/+1
| | | | | | <cstddef>. This was brought to my attention by Salvatore Benedetto in his port to a bare-metal coretex-m3. This exposed two test bugs where an explicit #include <cstdlib> was needed. llvm-svn: 160786
* Update <random> with constexpr support. Patch contributed by Jonathan Sauer.Howard Hinnant2012-04-021-4/+9
| | | | llvm-svn: 153896
* This is an initial commit of constexpr support as proposed by Richard Smith. ↵Howard Hinnant2012-04-021-2/+2
| | | | | | This by no means completes constexpr support. Indeed, it hardly scratches the surface. All it does is lay the foundation in <__config> and changes those few places in the library that are already using that foundation. llvm-svn: 153856
* The exception recovery mechanism for the uninitialized_* algorithms did not ↵Howard Hinnant2011-12-291-0/+2
| | | | | | work for iterators into discontiguous memory. llvm-svn: 147343
* Quash a whole bunch of warningsHoward Hinnant2011-12-011-9/+43
| | | | llvm-svn: 145624
* Further macro protection by replacing _[A-Z] with _[A-Z]pHoward Hinnant2011-11-291-41/+41
| | | | llvm-svn: 145410
* Add protection from min/max macrosHoward Hinnant2011-11-291-0/+2
| | | | llvm-svn: 145407
* Remove redundant iterator assignment detected by Marshall ClowHoward Hinnant2011-11-281-3/+0
| | | | llvm-svn: 145265
* Fixed bug in __independent_bits_engine found by Nick (from stackoverflow)Howard Hinnant2011-10-271-2/+2
| | | | llvm-svn: 143104
* More windows port work by Ruben Van BoxemHoward Hinnant2011-10-221-69/+76
| | | | llvm-svn: 142732
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | llvm-svn: 142235
* Initial checkin for debug mode (version 2)Howard Hinnant2011-09-141-75/+81
| | | | llvm-svn: 139711
* Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574Howard Hinnant2011-08-121-0/+12
| | | | llvm-svn: 137522
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-192/+192
| | | | llvm-svn: 134190
* noexcept for <utility>. This included a little repair on pair, and some ↵Howard Hinnant2011-05-271-7/+1
| | | | | | noexcept workarounds. llvm-svn: 132186
* Fix copy_n to increment only n-1 times for an input iterator. This works ↵Howard Hinnant2011-02-271-1/+10
| | | | | | much better with std::istream_iterator<int>(std::cin). Credit: Matan Nassau. llvm-svn: 126581
* Chris Jefferson noted many places where function calls needed to be ↵Howard Hinnant2011-02-141-1/+1
| | | | | | qualified (thanks Chris). llvm-svn: 125510
* N3142. Many of these traits are just placeholders with medium quality ↵Howard Hinnant2010-11-191-12/+12
| | | | | | emulation; waiting on compiler intrinsics to do it right. llvm-svn: 119854
* LWG 1432Howard Hinnant2010-11-181-1/+5
| | | | llvm-svn: 119611
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* Fixed bug in random_shuffle to avoid swapping with selfHoward Hinnant2010-10-221-3/+14
| | | | llvm-svn: 117098
* Changed __config to react to all of clang's currently documented has_feature ↵Howard Hinnant2010-09-041-1/+1
| | | | | | flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature. llvm-svn: 113086
* Fixing whitespace problemsHoward Hinnant2010-08-221-66/+65
| | | | llvm-svn: 111750
* US 122, N3106Howard Hinnant2010-08-211-43/+156
| | | | llvm-svn: 111742
* weekly test results plus a bug fix clang foundHoward Hinnant2010-05-271-14/+14
| | | | llvm-svn: 104877
* Completed [alg.random.shuffle].Howard Hinnant2010-05-261-86/+260
| | | | llvm-svn: 104708
* patch by Jeffrey Yasskin for porting to Ubuntu Hardy. Everything was ↵Howard Hinnant2010-05-241-5/+1
| | | | | | accepted except there were some bug fixes needed in <locale> for the __nolocale_* series. For the apple branch I ended up using templates instead of the var_args solution because it seemed both safer and more efficient. llvm-svn: 104516
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+5034
llvm-svn: 103490
OpenPOWER on IntegriCloud