diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-01-11 10:03:25 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-01-11 10:03:25 +0100 |
commit | d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch) | |
tree | b318cf594dc1da2fa48224005945c9157f35bb41 /Source/JavaScriptCore/wtf/Functional.h | |
parent | 6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff) | |
download | qtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz |
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/JavaScriptCore/wtf/Functional.h')
-rw-r--r-- | Source/JavaScriptCore/wtf/Functional.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/wtf/Functional.h b/Source/JavaScriptCore/wtf/Functional.h index 86d6203cf..bd0f3e282 100644 --- a/Source/JavaScriptCore/wtf/Functional.h +++ b/Source/JavaScriptCore/wtf/Functional.h @@ -136,6 +136,26 @@ private: R (*m_function)(P1, P2); }; +template<typename R, typename P1, typename P2, typename P3> +class FunctionWrapper<R (*)(P1, P2, P3)> { +public: + typedef R ResultType; + static const bool shouldRefFirstParameter = false; + + explicit FunctionWrapper(R (*function)(P1, P2, P3)) + : m_function(function) + { + } + + R operator()(P1 p1, P2 p2, P3 p3) + { + return m_function(p1, p2, p3); + } + +private: + R (*m_function)(P1, P2, P3); +}; + template<typename R, typename C> class FunctionWrapper<R (C::*)()> { public: |