From: David Blaikie Date: Wed, 12 Nov 2014 03:28:57 +0000 (+0000) Subject: Fix non-variadic function_ref cases to match r221753 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e645e40ac24b42dd7768f046eee964ddc9ad1ed1;p=platform%2Fupstream%2Fllvm.git Fix non-variadic function_ref cases to match r221753 llvm-svn: 221763 --- diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 16f850c..4e56e4d 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -103,7 +103,10 @@ class function_ref { public: template - function_ref(Callable &&callable) + function_ref(Callable &&callable, + typename std::enable_if< + !std::is_same::type, + function_ref>::value>::type * = nullptr) : callback(callback_fn::type>), callable(reinterpret_cast(&callable)) {} Ret operator()() const { return callback(callable); } @@ -122,7 +125,10 @@ class function_ref { public: template - function_ref(Callable &&callable) + function_ref(Callable &&callable, + typename std::enable_if< + !std::is_same::type, + function_ref>::value>::type * = nullptr) : callback(callback_fn::type>), callable(reinterpret_cast(&callable)) {} Ret operator()(Param1 param1) { @@ -144,7 +150,10 @@ class function_ref { public: template - function_ref(Callable &&callable) + function_ref(Callable &&callable, + typename std::enable_if< + !std::is_same::type, + function_ref>::value>::type * = nullptr) : callback(callback_fn::type>), callable(reinterpret_cast(&callable)) {} Ret operator()(Param1 param1, Param2 param2) { @@ -170,7 +179,10 @@ class function_ref { public: template - function_ref(Callable &&callable) + function_ref(Callable &&callable, + typename std::enable_if< + !std::is_same::type, + function_ref>::value>::type * = nullptr) : callback(callback_fn::type>), callable(reinterpret_cast(&callable)) {} Ret operator()(Param1 param1, Param2 param2, Param3 param3) {