From a175306f50a7189a38c79acdbd3f13270591955d Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 9 Sep 2018 01:11:58 +0200 Subject: [PATCH] TreeExplorer: allow to drive the function traits solely by the function signature ...which still needs to be the *concrete* signature of the funcition to pass, but we'll attempt to loosen that requirement in the next refactoring steps --- src/lib/iter-tree-explorer.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/iter-tree-explorer.hpp b/src/lib/iter-tree-explorer.hpp index 46debeb6d..7270a1683 100644 --- a/src/lib/iter-tree-explorer.hpp +++ b/src/lib/iter-tree-explorer.hpp @@ -469,10 +469,13 @@ namespace lib { * keep the argument-accepting front-end still generic (templated `operator()`). This * special adapter supports the case when the _expansion functor_ yields a child sequence * type different but compatible to the original source sequence embedded in TreeExplorer. - * @tparam FUN something _"function-like"_ passed as functor to be bound - * @tparam SRC the source iterator type to apply when attempting to use a generic lambda as functor + * @tparam FUN either the signature, or something _"function-like"_ passed as functor to be bound + * @tparam SRC (optional) but need to specify the source iterator type to apply when passing + * a generic lambda or template as FUN. Such a generic functor will be _instantiated_ + * passing the type `SRC&` as argument. This instantiation may fail (and abort compilation), + * but when it succeeds, we can infer the result type `Res` from the generic lambda */ - template + template struct _FunTraits { /** handle all regular "function-like" entities */ @@ -492,7 +495,7 @@ namespace lib { }; - using Sig = typename FunDetector::Sig; + using Sig = typename FunDetector::Sig; using Arg = typename _Fun::Args::List::Head; // assuming function with a single argument using Res = typename _Fun::Ret;