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/functions-regex.cxx | 132 ++------------------------------------------- 1 file changed, 4 insertions(+), 128 deletions(-) (limited to 'build2/functions-regex.cxx') diff --git a/build2/functions-regex.cxx b/build2/functions-regex.cxx index 9c428fd..8c1e4c5 100644 --- a/build2/functions-regex.cxx +++ b/build2/functions-regex.cxx @@ -423,22 +423,6 @@ namespace build2 return replace (move (s), re, fmt, move (flags)); }; - f[".replace"] = [](value s, string re, names fmt, optional flags) - { - return replace (move (s), - re, - convert (move (fmt)), - move (flags)); - }; - - f[".replace"] = [](value s, names re, string fmt, optional flags) - { - return replace (move (s), - convert (move (re)), - fmt, - move (flags)); - }; - f[".replace"] = [](value s, names re, names fmt, optional flags) { return replace (move (s), @@ -467,22 +451,6 @@ namespace build2 return split (move (s), re, fmt, move (flags)); }; - f[".split"] = [](value s, string re, names fmt, optional flags) - { - return split (move (s), - re, - convert (move (fmt)), - move (flags)); - }; - - f[".split"] = [](value s, names re, string fmt, optional flags) - { - return split (move (s), - convert (move (re)), - fmt, - move (flags)); - }; - f[".split"] = [](value s, names re, names fmt, optional flags) { return split (move (s), @@ -523,93 +491,17 @@ namespace build2 }; f[".merge"] = [](names s, - string re, - names fmt, - optional delim, - optional flags) - { - return merge (move (s), - re, - convert (move (fmt)), - move (delim), - move (flags)); - }; - - f[".merge"] = [](names s, - names re, - string fmt, - optional delim, - optional flags) - { - return merge (move (s), - convert (move (re)), - fmt, - move (delim), - move (flags)); - }; - - f[".merge"] = [](names s, names re, names fmt, - optional delim, + optional delim, optional flags) { return merge (move (s), convert (move (re)), convert (move (fmt)), - move (delim), - move (flags)); - }; - - f[".merge"] = [](names s, - string re, - string fmt, - names delim, - optional flags) - { - return merge (move (s), - re, - fmt, - convert (move (delim)), - move (flags)); - }; - - f[".merge"] = [](names s, - string re, - names fmt, - names delim, - optional flags) - { - return merge (move (s), - re, - convert (move (fmt)), - convert (move (delim)), - move (flags)); - }; - - f[".merge"] = [](names s, - names re, - string fmt, - names delim, - optional flags) - { - return merge (move (s), - convert (move (re)), - fmt, - convert (move (delim)), - move (flags)); - }; - - f[".merge"] = [](names s, - names re, - names fmt, - names delim, - optional flags) - { - return merge (move (s), - convert (move (re)), - convert (move (fmt)), - convert (move (delim)), + delim + ? convert (move (*delim)) + : optional (), move (flags)); }; @@ -639,22 +531,6 @@ namespace build2 return apply (move (s), re, fmt, move (flags)); }; - f[".apply"] = [](names s, string re, names fmt, optional flags) - { - return apply (move (s), - re, - convert (move (fmt)), - move (flags)); - }; - - f[".apply"] = [](names s, names re, string fmt, optional flags) - { - return apply (move (s), - convert (move (re)), - fmt, - move (flags)); - }; - f[".apply"] = [](names s, names re, names fmt, optional flags) { return apply (move (s), -- cgit v1.1