[PATCH] D54410: [libc++] Add C++17 deduction guides for std::function
Marshall Clow via Phabricator
reviews at reviews.llvm.org
Thu Jan 10 10:36:56 PST 2019
mclow.lists added inline comments.
Herald added a subscriber: jkorous.
================
Comment at: libcxx/include/functional:1704
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_DEDUCTION_GUIDES)
+template<class _Rp, class ..._Ap>
----------------
In the rest of the library we just check for `_LIBCPP_HAS_NO_DEDUCTION_GUIDES`, trusting that it is set correctly.
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
================
Comment at: libcxx/include/functional:1711-1745
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
+struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); };
+template<class _Rp, class _Gp, class ..._Ap>
----------------
ldionne wrote:
> Do we have something similar elsewhere I could reuse? This is ugly :(
Can you use `__member_pointer_traits_imp` (in type_traits)?
Repository:
rCXX libc++
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54410/new/
https://reviews.llvm.org/D54410
More information about the libcxx-commits
mailing list