summaryrefslogtreecommitdiffstats
path: root/libcxx/include/algorithm
Commit message (Collapse)AuthorAgeFilesLines
...
* Make the helper routines in string really be constexpr. This required a bit ↵Marshall Clow2014-06-101-5/+15
| | | | | | of refacoring in algorithm as well. Give them better names while we're at it. All of these are internal rotines; no visible functionality change. llvm-svn: 210561
* Per N3924, mark random_shuffle as deprecated in the synopsis for ↵Marshall Clow2014-03-031-2/+3
| | | | | | <algorithm>. Since we don't actually do anything when a call is deprecated, there is no functionality change. Maybe someday, we'll decide to warn when using a deprecated function. llvm-svn: 202672
* Implement LWG2350: min, max, and minmax should be constexpr.Marshall Clow2014-02-191-55/+114
| | | | llvm-svn: 201697
* G M: Restore the ability for libcxx to compile again on mingw 64.Howard Hinnant2013-09-171-0/+3
| | | | llvm-svn: 190837
* Rename _LIBCPP_DEBUG2 to _LIBCPP_DEBUG.Howard Hinnant2013-08-231-71/+71
| | | | llvm-svn: 189140
* Debug mode for string. This commit also marks the first time libc++ ↵Howard Hinnant2013-08-231-0/+4
| | | | | | debug-mode has found a bug (found one in regex). Had to play with extern templates a bit to get this to work since string is heavily used within libc++.dylib. llvm-svn: 189114
* Zhihao Yuan noted that there were a few unneeded statements. Eliminated ↵Howard Hinnant2013-08-221-1/+1
| | | | | | the unnecessary ones, and commented the ones that are there for non-obvious reasons such as to help things limp along in C++03 language mode. llvm-svn: 189039
* Xing Xue: port to IBM XLC++/AIX.Howard Hinnant2013-08-141-0/+4
| | | | llvm-svn: 188396
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-121-38/+38
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which isHoward Hinnant2013-08-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can also define _MSC_VER, and MSVCRT is not necessarily the only C runtime, these macros should not be used interchangeably. This patch divides all Windows-related bits into the aforementioned categories. Two new macros are introduced: - _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using _MSC_VER, excluding Clang. - _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default when _WIN32 is defined. This leaves _WIN32 for code using the Windows API. This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF. Nico, please prepare a patch for CREDITS.TXT, thanks. llvm-svn: 187593
* Taking another swing at correctly optimizing fill_n.Howard Hinnant2013-08-011-9/+11
| | | | llvm-svn: 187587
* Constrain fill_n -> memset operations to include implicit convertibility to ↵Howard Hinnant2013-08-011-0/+1
| | | | | | unsigned char. This fixes http://llvm.org/bugs/show_bug.cgi?id=16764. Also a drive-by fix on a chrono test suite bug. llvm-svn: 187552
* Fix a bug in std::fill_n where memset would end up being called in cases ↵Anders Carlsson2013-07-221-2/+2
| | | | | | | | when it shouldn’t. Reviewed by Howard. llvm-svn: 186875
* 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