This patch is the last in a series that replaces recursive meta-programming
in std::tuple with non-recursive implementations.
Previously std::tuple could only be instantiated with 126 elements before
it blew the max template instantiation depth. Now the size of std::tuple is
essentially unbounded (I've tested with over 5000 elements).
One unfortunate side-effect of this change is that tuple_constructible
and similar no longer short circuit after the first failure. Instead they
evaluate the conditions for all elements. This could be potentially breaking.
I plan to look into this further.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274331 91177308-0d34-0410-b5e6-96231b3b80d8
This patch attempts to improve the QoI of std::tuples tuple_element and
__make_tuple_types helpers. Previously they required O(N) instantiations,
one for every element in the tuple
The new implementations are O(1) after __tuple_indices<Id...> is created.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274330 91177308-0d34-0410-b5e6-96231b3b80d8
The previous __make_tuple_indices implementation caused O(N) instantiations
and was pretty inefficient. The C++14 __make_integer_sequence implementation
is much better, since it either uses a builtin to generate the sequence or
a very nice Log8(N) implementation provided by richard smith.
This patch moves the __make_integer_sequence implementation into __tuple
and uses it to implement __make_tuple_indices.
Since libc++ can't expose the name 'integer_sequence' in C++11 this patch
also introduces a dummy type '__integer_sequence' which is used when generating
the sequence. One the sequence is generated '__integer_sequence' can be
converted into the required type; either '__tuple_indices' or 'integer_sequence'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274286 91177308-0d34-0410-b5e6-96231b3b80d8
* P0163r0: Implemented in r273839.
* LWG 2309: pthread_mutex_lock only returns this error if certain debug flags
were passed during construction. libc++ does not pass these flags. There is
nothing to do.
* LWG 2310: Wording fix. No impact on libc++'s implementation.
* LWG 2312: libc++'s std::tuple implementation already constrains the overloads
based on the number of arguments.
* LWG 2549: libc++'s std::tuple already applied this fix.
* LWG 2674: libc++ already depends on this relaxed wording.
* LWG 2704, 2706, 2707, 2719, 2720, 2721, 2723, 2725, 2728: All of these filesystem were either
submitted by me and fixed before submission, or have already been applied.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274214 91177308-0d34-0410-b5e6-96231b3b80d8
Since at least the C++11 standard insert iterators are specified
as having ::reference typedef void. Libc++ was not doing that.
This patch corrects the typedef.
This patch changes the std::iterator base class of insert_iterator,
front_insert_iterator and back_insert_iterator. This should not
be an ABI breaking change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274209 91177308-0d34-0410-b5e6-96231b3b80d8
This patch adds the weak_type typedef in shared_ptr. It is available in
C++17 and newer.
This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to
have the value of 16, since 2016 is the current year.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273839 91177308-0d34-0410-b5e6-96231b3b80d8
See https://llvm.org/bugs/show_bug.cgi?id=27115
The problem was that the conversion from
'const enable_shared_from_this<T>*' to 'const T*' didn't work if
T inherited enable_shared_from_this as a virtual base class. The fix
is to take the original pointer passed to shared_ptr's constructor in the
__enable_weak_this method and perform an upcast to 'const T*' instead of
performing a downcast from the enable_shared_from_this base.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273835 91177308-0d34-0410-b5e6-96231b3b80d8
The move constructor for wstring_convert accidentally copied the state member
into the converted count member in the move constructor. This patch fixes
the typo.
While working on this I discovered that wstring_convert doesn't actually
provide a move constructor according to the standard and therefore this
constructor is a libc++ extension. I'll look further into whether libc++ should
provide this constructor at all. Neither libstdc++ or MSVC's STL provide it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273831 91177308-0d34-0410-b5e6-96231b3b80d8
This patch makes the bind placeholders in std::placeholders both (1) const and
(2) constexpr (See below).
This is technically a breaking change for any code using the placeholders
outside of std::bind and depending on them being non-const. However I don't
think this will break any real world code.
(1) Previously the placeholders were non-const extern globals in all
dialects. This patch changes these extern globals to be const in all dialects.
Since the cv-qualifiers don't participate in name mangling for globals this
is an ABI compatible change.
(2) Make the placeholders constexpr in C++11 and beyond. Although LWG 2488 only
applies to C++17 I don't see any reason not to backport this change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273824 91177308-0d34-0410-b5e6-96231b3b80d8