[PATCH] [libcxx] Add <experimental/tuple> header for LFTS.

Eric Fiselier eric at efcs.ca
Tue Jul 15 00:03:14 PDT 2014


Hi mclow.lists,

This patch adds the `<experimental/tuple>` header (almost) as specified in the latest draft of the library fundamentals TS.

The main changes in this patch are:

1. Added variable template `tuple_size_v`
2. Added function `apply(Func &&, Tuple &&)`.
3. Added feature macro `__cpp_lib_experimental_apply`
4. Changed `__invoke` to be `_LIBCPP_CONSTEXPR_AFTER_CXX11`.

The `apply(...)` implementation uses `__invoke` to invoke the given function. `__invoke` already provides the required functionality. Using `__invoke` also allows `apply` to be used on pointers to member function/objects as an extension. In order to facilitate this `__invoke` has to be marked `constexpr`.

http://reviews.llvm.org/D4512

Files:
  include/__functional_base
  include/experimental/tuple
  include/type_traits
  test/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp
  test/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp
  test/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp
  test/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp
  test/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp
  test/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp
  test/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp
  test/experimental/utilities/tuple/tuple.apply/types.pass.cpp
  test/experimental/utilities/tuple/tuple_size_v.fail.cpp
  test/experimental/utilities/tuple/tuple_size_v.pass.cpp
  test/experimental/utilities/tuple/tuple_size_v_2.fail.cpp
  test/experimental/utilities/tuple/tuple_size_v_3.fail.cpp
  test/experimental/utilities/tuple/version.pass.cpp
  www/ts1z_status.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4512.11419.patch
Type: text/x-patch
Size: 49840 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140715/ccd2bc1a/attachment.bin>


More information about the cfe-commits mailing list