From 55e858010b9ba53c27475d9ce6f864a84d28fa81 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 14 Jul 2018 18:30:28 +0200 Subject: Resolve function overload via the argument reversal to untyped --- build2/function.hxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build2/function.hxx') diff --git a/build2/function.hxx b/build2/function.hxx index 62666cc..139f1fa 100644 --- a/build2/function.hxx +++ b/build2/function.hxx @@ -45,9 +45,6 @@ namespace build2 // expected to issue diagnostics and throw failed. Note that the arguments // are conceptually "moved" and can be reused by the implementation. // - // @@ Maybe it makes sense to implicitly convert types like string to names - // -- providing all the overload combinations really gets tedious. - // // A function can also optionally receive the current scope by having the // first argument of the const scope* type. It may be NULL is the function // is called out of any scope (e.g., command line). @@ -72,6 +69,12 @@ namespace build2 // For more examples/ideas, study the existing function families (reside // in the functions-*.cxx files). // + // Note that normally there will be a function overload that has all the + // parameters untyped with an implementation that falls back to one of the + // overloads that have all the parameters typed, possibly inferring the type + // from the argument value "syntax" (e.g., presence of a trailing slash for + // a directory path). + // struct function_overload; using function_impl = value (const scope*, -- cgit v1.1