From 7b6713bcab38dac2309fb96c6eb3777b6527a64b Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 25 Mar 2016 02:25:51 +0100 Subject: [PATCH] extend lamda-signature-extracting metafunction to several arguments --- .../diff/tree-mutator-attribute-binding.hpp | 3 ++- src/lib/diff/tree-mutator.hpp | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/lib/diff/tree-mutator-attribute-binding.hpp b/src/lib/diff/tree-mutator-attribute-binding.hpp index 0ce8affe8..d4c6b592f 100644 --- a/src/lib/diff/tree-mutator-attribute-binding.hpp +++ b/src/lib/diff/tree-mutator-attribute-binding.hpp @@ -66,7 +66,8 @@ virtual void setAttribute (ID id, Attribute& newValue) { - using ValueType = typename _ClosureType::ArgType; + using Args = typename _ClosureType::Args; + using ValueType = typename lib::meta::Pick::Type; if (id == attribID_) change_(newValue.get()); diff --git a/src/lib/diff/tree-mutator.hpp b/src/lib/diff/tree-mutator.hpp index d0c97d225..645e88bbb 100644 --- a/src/lib/diff/tree-mutator.hpp +++ b/src/lib/diff/tree-mutator.hpp @@ -272,6 +272,7 @@ namespace diff{ namespace { // Mutator-Builder decorator components... using lib::meta::Strip; + using lib::meta::Types; /** * Type rebinding helper to pick up the actual argument type. @@ -285,12 +286,27 @@ namespace diff{ : _ClosureType { }; - template - struct _ClosureType + template + struct _ClosureType { - typedef ARG ArgType; - typedef RET ReturnType; + using Args = typename Types::Seq; + using Ret = RET; + using Sig = RET(ARGS...); }; + + template + struct _ClosureType + { + using Args = typename Types::Seq; + using Ret = RET; + using Sig = RET(ARGS...); + }; + + + template + struct has_Sig + : std::is_same::Sig> + { };