[PATCH] D28222: [libcxx] Re-implement LWG 2770 again: Fix tuple_size to work with structured bindings
Richard Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 3 00:35:02 PST 2017
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
LGTM, but a minor simplification seems possible.
================
Comment at: include/__tuple:32
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<const _Tp>
- : public __tuple_size_base_type<_Tp>::type {};
+class _LIBCPP_TYPE_VIS_ONLY tuple_size<__enable_if_tuple_size_imp<const _Tp, decltype(tuple_size<typename remove_cv<_Tp>::type>::value)>>
+ : public integral_constant<size_t, tuple_size<_Tp>::value> {};
----------------
remove_cv looks redundant here, deduction already stripped the cv qualifiers.
https://reviews.llvm.org/D28222
More information about the cfe-commits
mailing list