[cfe-commits] [libcxx] r131409 - /libcxx/trunk/include/__functional_base

Howard Hinnant hhinnant at apple.com
Mon May 16 09:20:21 PDT 2011


Author: hhinnant
Date: Mon May 16 11:20:21 2011
New Revision: 131409

URL: http://llvm.org/viewvc/llvm-project?rev=131409&view=rev
Log:
Spit 5th bullet __invoke into function pointers and everything else because result_of doesn't deal with function pointers.

Modified:
    libcxx/trunk/include/__functional_base

Modified: libcxx/trunk/include/__functional_base
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__functional_base?rev=131409&r1=131408&r2=131409&view=diff
==============================================================================
--- libcxx/trunk/include/__functional_base (original)
+++ libcxx/trunk/include/__functional_base Mon May 16 11:20:21 2011
@@ -430,6 +430,14 @@
 
 // fifth bullet
 
+template <class _R, class ..._Param, class ..._Args>
+inline _LIBCPP_INLINE_VISIBILITY
+_R
+__invoke(_R (*__f)(_Param...), _Args&& ...__args)
+{
+    return __f(_STD::forward<_Args>(__args)...);
+}
+
 template <class _F, class ..._T>
 inline _LIBCPP_INLINE_VISIBILITY
 typename result_of<_F(_T...)>::type





More information about the cfe-commits mailing list