[cfe-commits] [libcxx] r115461 - /libcxx/trunk/include/__functional_base_03

Douglas Gregor dgregor at apple.com
Sun Oct 3 09:53:02 PDT 2010


On Oct 3, 2010, at 6:59 AM, Howard Hinnant wrote:

> Author: hhinnant
> Date: Sun Oct  3 08:59:56 2010
> New Revision: 115461
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=115461&view=rev
> Log:
> Tweak to make clang blocks work with std::functional (very fragile)

Won't we need _Block_copy calls when putting a block into a std::function, _Block_dispose when destroying that std::function, etc?

	- Doug

> 
> Modified:
>    libcxx/trunk/include/__functional_base_03
> 
> Modified: libcxx/trunk/include/__functional_base_03
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__functional_base_03?rev=115461&r1=115460&r2=115461&view=diff
> ==============================================================================
> --- libcxx/trunk/include/__functional_base_03 (original)
> +++ libcxx/trunk/include/__functional_base_03 Sun Oct  3 08:59:56 2010
> @@ -873,7 +873,7 @@
> 
> template <class _F>
> inline _LIBCPP_INLINE_VISIBILITY
> -typename result_of<_F()>::type
> +decltype(declval<_F>()())
> __invoke(_F __f)
> {
>     return __f();
> @@ -881,7 +881,7 @@
> 
> template <class _F, class _A0>
> inline _LIBCPP_INLINE_VISIBILITY
> -typename result_of<_F(_A0)>::type
> +decltype(declval<_F>()(declval<_A0&>()))
> __invoke(_F __f, _A0& __a0)
> {
>     return __f(__a0);
> @@ -889,7 +889,7 @@
> 
> template <class _F, class _A0, class _A1>
> inline _LIBCPP_INLINE_VISIBILITY
> -typename result_of<_F(_A0, _A1)>::type
> +decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>()))
> __invoke(_F __f, _A0& __a0, _A1& __a1)
> {
>     return __f(__a0, __a1);
> @@ -897,7 +897,7 @@
> 
> template <class _F, class _A0, class _A1, class _A2>
> inline _LIBCPP_INLINE_VISIBILITY
> -typename result_of<_F(_A0, _A1, _A2)>::type
> +decltype(declval<_F>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>()))
> __invoke(_F __f, _A0& __a0, _A1& __a1, _A2& __a2)
> {
>     return __f(__a0, __a1, __a2);
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list