Repository: mesos Updated Branches: refs/heads/master 7beea9cbe -> 1074a9c3f
Fixed the signature of `CallableOnce::operator()`. This changes `operator()` signature to match the one defined in `CallableOnce` template parameter. Previously used form incorrectly specifies that `operator()` can be invoked with arbitrary number and types of parameters, which can break other templates using SFINAE to check if function object can be invoked with specific parameters. Review: https://reviews.apache.org/r/64337/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1074a9c3 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1074a9c3 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1074a9c3 Branch: refs/heads/master Commit: 1074a9c3fd7aa9d2e4b484f86dbe657271abecc0 Parents: 7beea9c Author: Dmitry Zhuk <dz...@twopensource.com> Authored: Tue Dec 5 07:23:28 2017 -0800 Committer: Michael Park <mp...@apache.org> Committed: Tue Dec 5 07:44:36 2017 -0800 ---------------------------------------------------------------------- 3rdparty/stout/include/stout/lambda.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/1074a9c3/3rdparty/stout/include/stout/lambda.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/lambda.hpp b/3rdparty/stout/include/stout/lambda.hpp index 96586bd..c9212be 100644 --- a/3rdparty/stout/include/stout/lambda.hpp +++ b/3rdparty/stout/include/stout/lambda.hpp @@ -364,18 +364,17 @@ public: CallableOnce& operator=(CallableOnce&&) = default; CallableOnce& operator=(const CallableOnce&) = delete; - template <typename... Args_> - R operator()(Args_&&... args) && + R operator()(Args... args) && { CHECK(f != nullptr); - return std::move(*f)(std::forward<Args_>(args)...); + return std::move(*f)(std::forward<Args>(args)...); } private: struct Callable { virtual ~Callable() = default; - virtual R operator()(Args...) && = 0; + virtual R operator()(Args&&...) && = 0; }; template <typename F> @@ -386,7 +385,7 @@ private: CallableFn(const F& f) : f(f) {} CallableFn(F&& f) : f(std::move(f)) {} - virtual R operator()(Args... args) && + virtual R operator()(Args&&... args) && { return internal::Invoke<R>{}(std::move(f), std::forward<Args>(args)...); }