Commit Graph

496 Commits

Author SHA1 Message Date
Howard Hinnant
7a563db09a Initial checkin for debug mode (version 2)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139711 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:33:51 +00:00
Howard Hinnant
9cbee430da Fix const correctness bug in __move_assign. Found and fixed by Ion Gaztañaga.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@139032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-02 20:42:31 +00:00
Howard Hinnant
6b171c557b Up version number by 1. This is a 'minor version' update.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@138978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 23:13:01 +00:00
Howard Hinnant
92a836c03d Reimplemented much of <istream> such that single character extractions do not check to see if this is the last character in the stream and thus never set eofbit. This fixes http://llvm.org/bugs/show_bug.cgi?id=10817 . This fix requires a recompiled libc++.dylib to be fully implemented. The recompiled libc++.dylib is ABI compatible with that shipped on Lion.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@138961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 21:02:45 +00:00
Howard Hinnant
5f255944ac __split_buffer should only require default constructible. Bug found and fixed by Jared Hoberock
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@138726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-28 15:21:29 +00:00
Howard Hinnant
3fdbbd2a6f Don't move assign string::allocator_type when propagate_on_container_move_assignment is false.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@137862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 20:36:18 +00:00
Howard Hinnant
43edf2d1e1 Fix needle-in-haystack bug found by Walter Brown
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@137617 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 17:22:22 +00:00
Howard Hinnant
e3e3291f3a Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@137522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 21:56:02 +00:00
Howard Hinnant
8775816ba3 Change how _LIBCPP_HAS_NO_ADVANCED_SFINAE gets set.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136596 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-31 17:10:44 +00:00
Howard Hinnant
199d0aec1b Fixed PR10507 (http://llvm.org/bugs/show_bug.cgi?id=10507)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-31 17:04:30 +00:00
Chandler Carruth
9d7530935d Revert r136547, r136545, and r136542 by removing slist.
This was checked in without review. It is not clear its reasonable to
include with libc++ at all, and needs discussion at a highlevel before
moving forward.

It's also completely lacking tests, and included several bugs in the
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 21:10:18 +00:00
Chandler Carruth
a73da5d2ca Revert r136546, which was submitted without review.
Original change:
Destruct elements of hash tables when removing individual entries from
the hash_table. I think this is the correct solution to PR10507, but I'm
not sure since this is a little bit cargo-culted. Howard, please review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136576 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 21:10:16 +00:00
Sean Hunt
8f0396e443 Add the missing default argument for the allocator and use a cleaner
implementation of previous().

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 00:47:53 +00:00
Sean Hunt
b59b929cc9 Destruct elements of hash tables when removing individual entries from
the hash_table. I think this is the correct solution to PR10507, but I'm
not sure since this is a little bit cargo-culted. Howard, please review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136546 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 00:18:12 +00:00
Sean Hunt
70bbcae9b5 Oops. That last commit was from an earlier revision of the file and was
more than just a bit broken. This one should compile and run without
infinite loops.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 00:06:52 +00:00
Sean Hunt
d50c1c7429 Include an "implementation" if SGI's slist. This was quickly hacked
together to get it working with code, and is neither optimal
(erase(Iterator, Iterator) calculates the previous iterator twice,
rather than calculating the previous iterator of the first one, then
advancing it until the second is found) nor complete (splice() was not
implemented). Most of the implementation is borrowed from forward_list
via using-declarations.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136542 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:42:36 +00:00
Sean Hunt
110b8bf57e Explicitly invoke the size_type specialization of max and min. This
avoids bugs where, when the allocator's size_type was smaller than int,
the multiplication or division would cause integral promotions and, with
two different integer types as arguments, deduction of the template
arguments would fail.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136540 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:31:58 +00:00
Sean Hunt
affd9e5d43 Add a new hash class in __gnu_ext for the extension containers. There
are two motivations for this.

First, this allows users who are specializing __gnu_ext::hash to
continue doing so without changing their code.

Second, SGI specifies hash overloads for char* and const char* that
perform a hash of the string, not of the pointer.

In order to support this, the hashing code for string is factored out.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136539 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:31:56 +00:00
Sean Hunt
e36a196049 Add two missing members from the extension hash containers. The first is
the type name 'data_type', which is specified by the SGI spec as being
the correct type name for the mapped type. The second is an overload of
insert found in standard containers, taking an iterator as a 'hint'
(which we ignore in the standard containers as well). libstdc++'s
implementation includes these overloads, and they are needed to make
insert_iterator work (which I suspect is the real motivation for
including them in the standard containers).

The motivation for including these overloads of insert and leaving the
mapped_type typedef is to make it easier for clients to migrate to the
standard containers.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:31:53 +00:00
Howard Hinnant
23369ee812 Configure to get along with 2.9 clang
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 21:35:53 +00:00
Howard Hinnant
db86663223 Optimizing valarray::operator=(some-valarray-expression)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 23:19:59 +00:00
Howard Hinnant
9c59d38112 Fix PR10509: http://llvm.org/bugs/show_bug.cgi?id=10509
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 19:25:28 +00:00
Howard Hinnant
d36369d910 Fix PR10510: http://llvm.org/bugs/show_bug.cgi?id=10510
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136232 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 18:34:06 +00:00
Howard Hinnant
4f598034d2 http://llvm.org/bugs/show_bug.cgi?id=10469
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 23:59:50 +00:00
Howard Hinnant
fa06d75e8d Optimization of string::operator< by M.E. O'Neill. Discussion in http://llvm.org/bugs/show_bug.cgi?id=10461
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 21:45:06 +00:00
Howard Hinnant
2644a7b3da http://llvm.org/bugs/show_bug.cgi?id=10461
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135873 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 15:07:21 +00:00
Howard Hinnant
099084d52f http://llvm.org/bugs/show_bug.cgi?id=10455
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135854 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 16:14:35 +00:00
Sean Hunt
737a351850 Given that __underlying_type is now available in clang, implement
std::underlying_type.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135410 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 18:37:21 +00:00
Howard Hinnant
464aa5cad3 http://llvm.org/bugs/show_bug.cgi?id=10390
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135393 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 15:51:59 +00:00
Howard Hinnant
bcbbd4d14f Revert locale for apple back to original design, getting rid of now useless helper *_l functions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 14:46:11 +00:00
Howard Hinnant
9a2078137f _LIBCXX_STABLE_APPLE_ABI -> _LIBCPP_STABLE_APPLE_ABI
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 14:25:40 +00:00
Sean Hunt
f3907e6cc0 Reapply 135035 with proper conditional inclusion, hopefully solving
issues with it.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135246 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 05:40:33 +00:00
Howard Hinnant
22ba71b8ef http://llvm.org/bugs/show_bug.cgi?id=10346
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135045 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 16:00:50 +00:00
Howard Hinnant
8d75632ad0 Reverted to 134947. Once I got into it, I discovered there were too many problems to fix in 135035.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135044 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 15:48:16 +00:00
Sean Hunt
c97da3a590 Implement the __nolocale functions properly so that they will work on
all platforms. Unfortunately a lot of this remains conditionally
compiled so as not to break Apple's ABI.

The new _LIBCPP_LOCALE__L_EXTENSIONS macro can be defined on other
platforms that support _l suffixes for all functions in order to use
them.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135035 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 06:40:50 +00:00
Sean Hunt
0389c53f44 Make sure that __time_put constructors properly on non-Apple platforms.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 00:55:04 +00:00
Howard Hinnant
2bf1c08510 Make vector<bool>::reference and const_reference public
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 15:50:42 +00:00
Sean Hunt
6f0342cf2e Don't assume that wctype produces a nice mask on all platforms. On
glibc, for instance, it's a const char *.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 03:40:04 +00:00
Sean Hunt
e59f724f79 Conditionally wrap the changes from r134781.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134783 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 01:09:31 +00:00
Sean Hunt
62a6ac33a2 Implement generalized table lookups for upper, lower, and character
traits.

To the best of my knowledge, this will not break the ABI for Apple.
However, it does introduce three publicly visible (although with
reserved name) functions that will fail to link against the just-shipped
Apple version of libc++. Since they are not used in any inline
functions, no actual breakage should occur.

If Howard doesn't want to put undefined functions (even internal ones)
into a header, they could be surrounded by additional conditional
compilation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134781 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 00:56:23 +00:00
Howard Hinnant
ac6de546bd Fixing up some ABI issues
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 21:03:52 +00:00
Howard Hinnant
9f66bffdbe Fix uninitialized loop counter. http://llvm.org/bugs/show_bug.cgi?id=10278
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134405 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 14:14:17 +00:00
Howard Hinnant
f03c3b4612 http://llvm.org/bugs/show_bug.cgi?id=10248
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 20:33:23 +00:00
Howard Hinnant
90d7785eba http://llvm.org/bugs/show_bug.cgi?id=10250
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134325 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 18:22:36 +00:00
Howard Hinnant
74248888ab Changed constraints on pair and tuple constructors from is_convertible to is_constructible.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134252 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 20:12:51 +00:00
Howard Hinnant
61aa6013c3 Correct for new rules regarding implicitly deleted special members. http://llvm.org/bugs/show_bug.cgi?id=10191
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 19:24:36 +00:00
Howard Hinnant
0949eedbd6 _STD -> _VSTD to avoid macro clash on windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 21:18:19 +00:00
Douglas Gregor
35d2fcfc8e Teach libc++ about the addressof() overloads it needs to work with
Objective-C Automatic Reference Counting, where Objective-C object
pointers can have several different qualifiers (__strong, __weak,
__autoreleasing, __unsafe_unretained). These addressof() overloads are
only provided in ARC mode, and the __weak variant is conditionalized
on having weak-reference support in the ARC runtime.

For historical reasons, Clang provides these definitions itself, and
defines the macro _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF to note when
it as done so. The code belongs here, and this redundancy will be
eliminated in the future.

Addresses <rdar://problem/9658274>.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@133656 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 22:17:44 +00:00
Howard Hinnant
7604fea08c More fixes: One of my fixes to type_traits earlier today was incorrect, so that is reverted. Recently clang appears to have tightened up its definition of is_convertible and that has caused some failures in [unordered_][multi]map. I've switched to using is_constructible to restablish the desired functionality in [unordered_][multi]map. Specifically, inserting rvalues of move-only types for the keys.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@133402 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-19 21:45:00 +00:00
Howard Hinnant
d4b957820c Miscellaneous minor fixes in <type_traits>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@133401 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-19 19:12:59 +00:00
Howard Hinnant
2b1b2d40d7 Provide names for template and function parameters in forward declarations. The purpose is to aid automated documentation tools.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@133008 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-14 19:58:17 +00:00
Howard Hinnant
c28dbeee52 Move nullptr_t to unversioned namespace: Sean Hunt
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-05 13:00:46 +00:00
Howard Hinnant
58cd8231d8 noexcept for <stack>. This completes noexcept for Chapter 23 [containers].
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132652 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 22:09:19 +00:00
Howard Hinnant
6a09441022 noexcept for <queue>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132650 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 21:32:33 +00:00
Howard Hinnant
04dae1df22 noexcept for <unordered_set>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 20:18:37 +00:00
Howard Hinnant
5f2f14c5d2 noexcept for <unordered_map>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 18:54:24 +00:00
Howard Hinnant
8b53768dac Made more implementation details of [multi]map/set noexcept.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 17:10:24 +00:00
Howard Hinnant
b2e2a8f6f3 noexcept for <set>. Plus a few fixes to noexcept for <map>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132640 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 15:22:34 +00:00
Howard Hinnant
7686add61e noexcept for <map>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 14:31:57 +00:00
Howard Hinnant
d1d27a4afa noexcept for <vector>. This also includes installing move_if_noexcept() into vector.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 19:40:40 +00:00
Howard Hinnant
53f7d4cc62 Bring noexcept for <string> inline with other containers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132573 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 18:40:47 +00:00
Howard Hinnant
c560727d5e noexcept for <list>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132562 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 17:30:28 +00:00
Howard Hinnant
b965fed10b noexcept for <forward_list>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132553 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 16:20:53 +00:00
Howard Hinnant
009b2c4583 After sleeping on it I've decided that all special members that can be noexcept, should be declared so. The client has the traits to detect and branch on this information, and it is often an important optimization. Give deque() a noexcept. Add test for deque default constructor and deque destructor.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132549 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 15:16:49 +00:00
Howard Hinnant
18884f4e9f Second try at getting noexcept on move and swap for deque. I changed std::alloctor to propagate_on_container_move_assignment so as to make deque<T> move assignment noexcept. What we really need is a compile-time switch that says an allocator always compares equal.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132490 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 21:38:57 +00:00
Howard Hinnant
0a612b0891 I've become quite disatsified with the lack of noexcept specifications on container move construction, move assignment operator and swap. Without proper decoration on at least move construction, vectors of containers will have unacceptable performance. Here's the fix for deque.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132480 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 20:00:14 +00:00
Howard Hinnant
8790cabd86 noexcept for forward_list.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132461 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 16:44:28 +00:00
Howard Hinnant
a12beb35e5 noexcept for deque.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132459 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 16:10:22 +00:00
Howard Hinnant
aabf28721b Experimental support for a meaningful __is_swappable<T>::value. This does not appear to be strictly needed for correct functioning of the library. If it causes any problems, I'd rather pull it sooner rather than later.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132421 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 19:59:32 +00:00
Howard Hinnant
d737382dfd Turning on cxx_nullptr exposed a latent bug in is_function, causing nullptr to wrongly classify as a function. Fixed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132406 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 17:25:11 +00:00
Howard Hinnant
083ba5f5ca I've seen this question enough times to know that it should be fixed: http://stackoverflow.com/questions/6193734/implicit-conversions-with-stdfunction
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132363 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 21:45:26 +00:00
Howard Hinnant
f0562af9dd noexcept for <array>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132359 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 21:06:33 +00:00
Howard Hinnant
20eda8b563 Upgrade <ratio> to use template aliases when available.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132342 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 16:55:36 +00:00
Howard Hinnant
c983454d30 noexcept for Chapter 22 [localization].
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132337 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 15:34:58 +00:00
Howard Hinnant
c26fd8061e Add _ATTRIBUTE macro for gcc: Justin Hibbits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132334 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 13:13:49 +00:00
Howard Hinnant
a6119a86c5 noexcept for Chapter 21 [strings].
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132296 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 19:57:12 +00:00
Howard Hinnant
ad1a5cc5f0 minor documentation update
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 13:53:56 +00:00
Howard Hinnant
0687adca37 noexcept for <typeindex>. This completes Chapter 20 [utilities].
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132267 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 18:57:24 +00:00
Howard Hinnant
0667433587 noexcept for <scoped_allocator>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 18:51:12 +00:00
Howard Hinnant
756a1763d1 noexcept for <chrono>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132265 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 18:34:36 +00:00
Howard Hinnant
603d2c0989 noexcept for <functional>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 17:59:48 +00:00
Howard Hinnant
1694d23e23 noexcept for <memory>. I've added a few extension noexcept to: allocator_traits<A>::deallocate, allocaate<T>::deallocate, return_temporary_buffer, and default_delete<T>::operator()(T*) const. My rationale was: If a std-dicated noexcept function needs to call another std-defined function, that called function must be noexcept. We're all a little new to noexcept, so things like this are to be expected. Also included fix for broken __is_swappable trait pointed out by Marc Glisse, thanks Marc|. And fixed a test case for is_nothrow_destructible. Destructors are now noexcept by default|
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 14:41:13 +00:00
Howard Hinnant
10f25d2739 noexcept for <bitset>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132216 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 20:52:28 +00:00
Howard Hinnant
a5e0121b8d noexcept for <tuple>. And in the process learned that I had done it wrong for pair's swap. I needed to create an __is_nothrow_swappable<T>::value trait that was smart enought to answer false when __is_swappable<T>::value is false. Otherwise one gets compile-time errors when using pair or tuple of non-swappable types, even if you never try to swap the pair or tuple.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 19:08:18 +00:00
Howard Hinnant
e9b2c2d669 noexcept for <utility>. This included a little repair on pair, and some noexcept workarounds.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132186 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 15:04:19 +00:00
Howard Hinnant
1e15fd1856 Applied noexcept to everything in [diagnostics] (Chapter 19)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 19:48:01 +00:00
Howard Hinnant
19ce6a4792 Turn on cxx_alias_templates support
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132134 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 19:07:54 +00:00
Howard Hinnant
ed56921d6e Applied noexcept to everything in [language.support] (Chapter 18)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 18:23:59 +00:00
Howard Hinnant
4b7a43da34 Added [[noreturn]] attribute everywhere it should be
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132125 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 17:07:32 +00:00
Howard Hinnant
ef54251a84 Fix const correctness bug in bind involving reference_wrapper found by Jonathan Sauer
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 15:07:43 +00:00
Howard Hinnant
e003ce4899 __invokable and __invoke_of now check for incomplete types and issue a compile-time diagnostic if they are used with incomplete types for anything except a return type. Note that both arguments *and* parameters are checked for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 00:09:02 +00:00
Howard Hinnant
bd89e4b0dd This is a simplified (and superior) implementation of __invoke, __invokable and __invoke_of. It is superior in that __invoke now handles reference qualified member functions whereas the previous implementation did not. And it simply has less infrastructure in its implementation. I'm still learning how to program in C++11 (and probably will be for a long time). This change does not impact the behavior we're seeing in http://llvm.org/bugs/show_bug.cgi?id=9975
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131761 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 22:02:53 +00:00
Howard Hinnant
0148a838d0 Simplied bind using __invoke. In the process, found and fixed a couple of bugs. C++11 only.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131667 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 19:41:47 +00:00
Howard Hinnant
57cff290a4 I had a giant misunderstanding of what 'synchronizes with' meant in [futures.async]/p5. This invalidated the current design of async in <future>. This is a new design, based on my new understanding, which has been confirmed on the lwg mailing list. The summary is that ~future() (and ~shared_future()) will block when they are created from within async, and the thread hasn't finished yet. As part of this work I created two new type traits: __invokable<F, Args...>::value and __invoke_of<F, Args...>::type. These are what result_of<F(Args...)> wanted to be when it grew up, but never will be. __invoke_of is carefully crafted so that it can serve as its own enable_if (type doesn't exist if the signature isn't invokable). All of this work is C++11 only.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 15:05:04 +00:00
Howard Hinnant
fead2e2de9 Fix ambiguity in operator== of scoped_allocator_adaptor.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131485 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 20:41:18 +00:00
Howard Hinnant
6b9826b2dc Fixed bug in recently introduced bind move constructor
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131484 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 20:27:51 +00:00
Howard Hinnant
ad935d583d Brought call_once variadic call up to current spec, which allows move-only functors and move-only arguments, but disallows functors with non-const lvalue reference parameters.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 19:05:11 +00:00
Howard Hinnant
656bdc3667 Brought thread variadic constructor up to current spec, which allows move-only functors and move-only arguments, but disallows functors with non-const lvalue reference parameters.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 18:40:35 +00:00
Howard Hinnant
ed22f562e5 Supply missing std::qualifier to call.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131410 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:20:59 +00:00
Howard Hinnant
941138f8c9 Spit 5th bullet __invoke into function pointers and everything else because result_of doesn't deal with function pointers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:20:21 +00:00
Howard Hinnant
496934a803 Supply missing move ctor in __bind_r, though this one will eventually be defaulted
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:19:01 +00:00
Howard Hinnant
37c53b6221 Redesign of result_of to handle reference-qualified member functions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131407 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:17:21 +00:00
Howard Hinnant
5ec7f5a518 Fix type-o found by Justin Hibbits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131348 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 18:20:45 +00:00
Howard Hinnant
e06b9965ad Fix type-o found by Justin Hibbits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131346 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 17:24:22 +00:00
Howard Hinnant
0a111118a6 http://llvm.org/bugs/show_bug.cgi?id=9854. Also created an emulated hexfloat literal for use in some of the tests. <sigh> And cleaned up some harmless but irritating warnings in the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131318 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 21:52:40 +00:00
Howard Hinnant
11a58a68e1 http://llvm.org/bugs/show_bug.cgi?id=9118
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131296 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 17:16:06 +00:00
Howard Hinnant
6063ec176d A much improved type_traits for C++0x. Not yet done: is_trivially_constructible, is_trivially_assignable and underlying_type.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 14:08:16 +00:00
Howard Hinnant
6b41c6047b Corrected some bugs in both memory and the tests. Preparing for being able to turn on support for alias templates.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 20:21:19 +00:00
Howard Hinnant
5d37fb32d2 Redid nothrow traits in terms of non-nothrow traits when noexcept is available
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131198 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 20:19:40 +00:00
Howard Hinnant
3666695f0d Updated type_traits and the type_traits design doc with recent work done in clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131090 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-09 19:21:17 +00:00
Howard Hinnant
469d419a17 Correction to set of overloaded pair constructors for C++0x
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@130521 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:10:55 +00:00
Douglas Gregor
7ac6af7027 Qualify calls to std::next(), to avoid conflicts with
libraries/applications that define their own 'next' template.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@130511 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 16:20:26 +00:00
Howard Hinnant
e14ea5835e http://llvm.org/bugs/show_bug.cgi?id=9765
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@129910 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 14:29:59 +00:00
Howard Hinnant
75f7695c62 Think-o in poisson_distribution at mean == 10
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@129520 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-14 15:59:22 +00:00
Howard Hinnant
ef3b2e2e34 Fix bug in Sseq constraints found by Seth Cantrell
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@129285 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 18:22:12 +00:00
Howard Hinnant
9dbeff919b http://llvm.org/bugs/show_bug.cgi?id=9672
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@129266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 02:18:41 +00:00
Howard Hinnant
8c1aa2c24d Changes to cerrno to protect against the case the ELAST is not defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@129255 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-10 19:46:55 +00:00
Howard Hinnant
506b36487c time_get was missing the %F specifier. This change impacts the binary.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@129251 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-10 17:54:14 +00:00
Howard Hinnant
a02851e8a2 Chris Jefferson found a missing const (Bugzilla 9632)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@128885 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 14:55:28 +00:00
Howard Hinnant
d615e47bea Chris Jefferson submitted this patch to fix http://llvm.org/bugs/show_bug.cgi?id=9351
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@128796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-03 20:05:29 +00:00
Howard Hinnant
154002bb5d Provide a more readable error message for <atomic> until it is implemented.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@128636 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-31 16:39:39 +00:00
Howard Hinnant
41fb6e1432 Jonathan Sauer found a bug in the way ^ was handled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@128350 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-26 20:02:27 +00:00
Howard Hinnant
d0a2fbfe60 http://llvm.org/bugs/show_bug.cgi?id=9444
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@127412 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 17:27:57 +00:00
Howard Hinnant
f9b8998795 I have to revert this recent fix to tuple conversions until clang implements cwg 1170. Without this fix pair and tuple don't convert properly. With it, associative containers get access errors when they shouldn't. cwg 1170 fixes the latter.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@127411 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 17:27:30 +00:00
Howard Hinnant
6e5e7e78ee Corrected const-correctness on nullptr type_traits, and beefed up the test for nullptr_t.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@127338 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-09 17:17:06 +00:00
Howard Hinnant
5885da34ce Walter Brown brought to my attention that type_traits was failing to correctly classify nullptr_t
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@127334 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-09 15:10:51 +00:00
Howard Hinnant
80586729e4 Chris Jefferson found a defect in the C++0x working draft by trying to run libc++ against boost. I've submitted an issue to the LWG, and this commit attempts to implement the proposed resolution of that defect report. I'd point to the issue but it hasn't been put into the LWG list yet. The title of the issue will be: Stage 2 accumulate incompatibilty
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@127303 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-09 01:03:19 +00:00
Howard Hinnant
fddf722f4e Chris Jefferson found this bug to pair/tuple introduced by a recent change to the draft that I missed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@126743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 14:27:55 +00:00
Howard Hinnant
171869e27c Fix copy_n to increment only n-1 times for an input iterator. This works much better with std::istream_iterator<int>(std::cin). Credit: Matan Nassau.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@126581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 20:55:39 +00:00
Howard Hinnant
df85e57f4a Fixed two problems found by Chris Jefferson: Made operator>> for char consistent with gcc. Opened an LWG issue on this one. 2) Renamed some private typedefs which are causing boost grief.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@126576 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 18:02:02 +00:00
Howard Hinnant
e7c8da6f2d http://llvm.org/bugs/show_bug.cgi?id=9326
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@126504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 19:52:41 +00:00
Howard Hinnant
b2080c70d4 Chris Jefferson spotted a problem with messages_base::catalog while getting libc++ to work on boost. The standard says this type must be an int. But this type is the key returned by the OS facility catopen. On OS X the type returned by catopen is void*, which doesn't fit into an int on 64 bit platforms. Chris suggested using ptrdiff_t instead of void*. It still isn't compliant with the standard, but chances are that this change will fix what is ailing boost. Chris also supplied the algorithm for distinguishing high-order pointers from error conditions. Thanks Chris.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@126462 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 00:51:08 +00:00
Howard Hinnant
6cf5d8c3aa Chris Jefferson noted many places where function calls needed to be qualified (thanks Chris).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@125510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 19:12:38 +00:00
Howard Hinnant
621ee222d9 fix stupid type-o
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@125311 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 21:34:42 +00:00
Howard Hinnant
31b8e617b6 Installed __has_feature(is_convertible_to) and __has_feature(is_base_of)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@125290 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 17:46:03 +00:00
Howard Hinnant
47a7cce01e Missing traits::to_int_type in fstream
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124727 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 17:37:16 +00:00
Howard Hinnant
2529d02b5d Qualify calls to addressof with std::. Bug 9106
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 17:36:20 +00:00
Howard Hinnant
211f0ee1be Bug 9096 - list::iterator not default constructible
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124508 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-28 23:46:28 +00:00
Howard Hinnant
80f9180729 minor corrections to test, and hook is_base_of up to clang intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-28 20:00:37 +00:00
Douglas Gregor
9ca45e21b8 Eliminate extraneous {};
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124456 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 23:36:08 +00:00
Howard Hinnant
99b2f7660d Make forward_list splice_after and merge work for lvalue lists
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 21:00:35 +00:00
Howard Hinnant
091c5ace78 Reverted previous fix to is_convertible as it caused more problems than it fixed. But this reverted fix will only matter for non-clang compilers. Installed __is_convertible_to for clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124429 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 21:00:00 +00:00
Douglas Gregor
497ac97247 Inline namespaces are always available in Clang. Rely on that without
testing via __has_feature, since __has_feature for C++0x features no
longer evaluates true in C++98/03 mode.

Also, eliminate the redundant using directive. Inline namespaces make
their members visible in the enclosing namespace automatically.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124293 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 15:39:56 +00:00
Douglas Gregor
aab015a929 Teach move_iterator that rvalue references cannot bind to non-function
lvalues, nor can one take the address of an xvalue, by adding
appropriate static_cast's (in the first case) and a temporary (in the
second case).


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124255 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 00:12:48 +00:00
Howard Hinnant
9f193f202f Add always_inline to string move constructors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124252 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 00:06:59 +00:00
Douglas Gregor
5ea2e37c08 Remove an (incorrect) compiler workaround in the __mu function. The
workaround relied on rvalue references binding to non-function
lvalues, while the original formulation (with std::forward) does the
right thing.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 23:11:15 +00:00
Howard Hinnant
56a85ca8bf tweak for readability (no functionality change)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124192 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 16:31:30 +00:00
Douglas Gregor
6c669943b3 An rvalue reference cannot bind to an lvalue, so static_cast the
result of the __tuple_leaf::get() call to an rvalue reference when
returning from tuple's get().


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 16:14:21 +00:00
Douglas Gregor
f9e1c7e367 Eliminate the C++0x-only is_convertible testing function that accepts
a cv-qualifier rvalue reference to the type, e.g.,

  template <class _Tp> char  __test(const volatile typename remove_reference<_Tp>::type&&);

The use of this function signature rather than the more
straightforward one used in C++98/03 mode, e.g.,

  template <class _Tp> char  __test(_Tp);

is broken in two ways:

  1) An rvalue reference cannot bind to lvalues, so is_convertible<X&,
  X&>::value would be false. This breaks two of the unique_ptr tests
  on Clang and GCC >= 4.5. Prior GCC's seem to have allowed rvalue
  references to bind to lvalues, allowing this bug to slip in.

  2) By adding cv-qualifiers to the type we're converting to, we get
  some incorrect "true" results for, e.g., is_convertible<const X&, X&>::value.





git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124166 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 01:15:41 +00:00
Howard Hinnant
f83417b823 Chandler Carruth changed >> to > > in several places.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 16:07:25 +00:00
Howard Hinnant
5f5859c45b Add attribute to inlined member.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@123392 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 20:05:05 +00:00
Howard Hinnant
6fd4b669ca Fixing an ambiguity in variadics found by clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@123337 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-12 22:56:59 +00:00
Howard Hinnant
ac38bae75b fix guard
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@123269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 20:02:45 +00:00
Howard Hinnant
52c4eb23e0 Two minor fixes: 1. Put integral_constant conversion to integral in even without constexpr support. 2. Add ios_base to <iosfwd>. The latter is being tracked by LWG 2026.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@123080 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 20:00:48 +00:00
Howard Hinnant
04240d90ef Reverting an old optimization that conflicts with the new allocator model, and causes some test casees to compile that shouldn't.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@122830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04 19:53:31 +00:00
Howard Hinnant
93c382bf45 Marshall Clow's fix for Bug 8421.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@122825 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04 19:21:05 +00:00
Howard Hinnant
2d72b1e393 Effort to reduce the number of exported symbols
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@122057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 14:46:43 +00:00
Howard Hinnant
e48e36623b Reduced copying cost of tuple_cat from quadratic to linear.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-12 23:04:37 +00:00
Howard Hinnant
0e1493ec5e LWG 1385 [FCD] tuple_cat should be a single variadic signature (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1385). This issue is only in Ready status, meaning it is not official, but probably will be this March in Madrid. It was tentatively accepted in Batavia with the previso that Bill and I didn't have any problems implementing it. This is my part of that agreement.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-11 20:47:50 +00:00
Howard Hinnant
eee7698bac The implementation of the new definition of result_of (N3123) resulted in some test failures in [func.memfn] that I failed to previously notice. This corrects that mistake.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-11 00:05:19 +00:00
Michael J. Spencer
626916fc25 Add CMake build and fix major Linux blockers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 19:47:54 +00:00
Howard Hinnant
31aaf55f4c N3158 Missing preconditions for default-constructed match_result objects
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 21:07:55 +00:00
Howard Hinnant
770d1c4ea7 After a long break to wait for the atomic spec to settle, this completes the library part of <atomic>. It currently won't even parse as it depends on the existence of the intrinsics specified at http://libcxx.llvm.org/atomic_design_a.html. Everything has been tested using fake intrinsics which have now been removed. As the intrinsics come online, the ATOMIC_* macros will need to be adjusted to reflect which operations are lock-free. These macros will probably need to be #ifdef'd for each supported platform.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 17:20:28 +00:00
Howard Hinnant
d2f6afbfab atomics ...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:24:41 +00:00
Howard Hinnant
91e2f26fec Work on <atomic> continues. The file size is actually sane now...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121181 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 20:46:14 +00:00
Howard Hinnant
4777bf2799 Getting <atomic> warmed back up. We have a hopefully more stable spec now. And I believe the intrinsic spec at http://libcxx.llvm.org/atomic_design_a.html is still good.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 23:10:08 +00:00
Howard Hinnant
a445151f4a N3189 Observers for the three handler functions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@120712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 16:45:21 +00:00
Howard Hinnant
7de47902d0 Implemented N3194
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@120458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 20:23:32 +00:00
Howard Hinnant
ac417faebc Minor fixup in <ratio> and add optional support for shared_mutex and upgrade_mutex which must be opted into with #define _LIBCPP_SHARED_LOCK
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@120258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 19:41:07 +00:00
Howard Hinnant
d397d03651 Add template alias emulation to <ratio>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@120098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 17:05:06 +00:00
Howard Hinnant
6689564040 N3188 - Revision to N3113: Async Launch Policies (CH 36)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@120027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 18:33:54 +00:00
Howard Hinnant
f8f852138f N3191: C++ Timeout Specification
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20 19:16:30 +00:00
Howard Hinnant
f048fe3a09 N3123
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20 18:25:22 +00:00
Howard Hinnant
1468b668aa N3142. Many of these traits are just placeholders with medium quality emulation; waiting on compiler intrinsics to do it right.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 22:17:28 +00:00
Howard Hinnant
995676a98e LWG 1522
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 17:34:48 +00:00
Howard Hinnant
9650b6cce3 LWG 1439
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 17:01:36 +00:00
Howard Hinnant
2f6a627394 LWG 1339
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 16:13:03 +00:00
Howard Hinnant
278bf2d289 LWG 1432
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119611 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 01:47:02 +00:00
Howard Hinnant
47761071be LWG 1404
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 01:40:00 +00:00
Howard Hinnant
34d6b19721 LWG 1325
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 21:53:14 +00:00
Howard Hinnant
7b2cb48cc1 LWG 1323
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 21:11:40 +00:00
Howard Hinnant
cd2254b454 LWG 1191
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 19:52:17 +00:00
Howard Hinnant
86ed8aefb2 LWG 1118
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 19:22:43 +00:00
Howard Hinnant
e32b5e2f23 Update <string> to use allocator_traits.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119522 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 17:55:08 +00:00
Howard Hinnant
b64f8b07c1 license change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 22:09:02 +00:00
Howard Hinnant
28dbbe0596 Dave Zarzycki showed how the efficiency of shared_ptr could be significantly
increased.  The following program is running 49% faster:

#include <iostream>
#include <memory>
#include <chrono>
#include <vector>
#include "chrono_io"

int main()
{
    typedef std::chrono::high_resolution_clock Clock;
    Clock::time_point t0 = Clock::now();
    {
        std::shared_ptr<int> p(new int (1));
        std::vector<std::shared_ptr<int> > v(1000000, p);
        v.insert(v.begin(), p);
        v.insert(v.begin(), p);
        v.insert(v.begin(), p);
        v.insert(v.begin(), p);
    }
    Clock::time_point t1 = Clock::now();
    std::cout << (t1-t0) << '\n';
}


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 21:33:17 +00:00
Howard Hinnant
726a76fb47 I have reverted all contributions made by Jesse Towner in revision 110724
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 21:10:23 +00:00
Howard Hinnant
4e59948249 Fixed bug in random_shuffle to avoid swapping with self
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@117098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 15:26:39 +00:00
Howard Hinnant
bce9c3132d [atomics.types.address]
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@117033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 17:44:19 +00:00
Howard Hinnant
5bbe97ddaa atomic_schar, atomic_uchar, atomic_short, atomic_ushort, atomic_int, atomic_uint, atomic_long, atomic_ulong, atomic_llong, atomic_ullong, atomic_char16_t, atomic_char32_t and atomic_wchar_t.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116860 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 21:22:10 +00:00
Howard Hinnant
e738501eb3 atomic_char
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 16:51:18 +00:00
Howard Hinnant
21ef47f436 Changing <atomic> to follow Design A
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 20:39:07 +00:00
Howard Hinnant
5306d68019 Convert __thread_local_data to the singleton pattern
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 19:18:04 +00:00
Howard Hinnant
8177207f3c Bug 7983 fixed by Bernhard Rosenkraenzer
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 17:11:39 +00:00
Howard Hinnant
3c143ad882 Patch by Marshall Clow to make the assignment operators of piecewise_constant_distribution and piecewise_linear_distribution exception safe.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 14:37:09 +00:00
Howard Hinnant
ffb9a4e235 Corrected an inconsistency with recent changes in tuple, and perfect forwarding within bind
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@115930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 18:03:23 +00:00
Howard Hinnant
6cac2c2c9c Make flag type configurable by the compiler
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@115614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 14:02:23 +00:00
Howard Hinnant
b4ac745466 Thanks Sebastian\!
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@115612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 13:38:23 +00:00
Howard Hinnant
002f1d341b Filling out the infrastructure in <atomic>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@115577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 23:55:35 +00:00
Howard Hinnant
26994e383c __has_feature crutch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@115540 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 19:01:30 +00:00