From 4168cda2363f3d796d0b9922852e249aac3131ba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Dec 2020 08:39:35 +0200 Subject: Mark Buildfile functions as pure or impure --- libbuild2/functions-project-name.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libbuild2/functions-project-name.cxx') diff --git a/libbuild2/functions-project-name.cxx b/libbuild2/functions-project-name.cxx index 86206b0..145e62c 100644 --- a/libbuild2/functions-project-name.cxx +++ b/libbuild2/functions-project-name.cxx @@ -13,46 +13,46 @@ namespace build2 { function_family f (m, "project_name"); - f["string"] = [](project_name p) {return move (p).string ();}; + f["string"] += [](project_name p) {return move (p).string ();}; - f["base"] = [](project_name p, optional ext) + f["base"] += [](project_name p, optional ext) { return ext ? p.base (ext->c_str ()) : p.base (); }; - f["base"] = [](project_name p, names ext) + f["base"] += [](project_name p, names ext) { return p.base (convert (move (ext)).c_str ()); }; - f["extension"] = &project_name::extension; - f["variable"] = &project_name::variable; + f["extension"] += &project_name::extension; + f["variable"] += &project_name::variable; // Project name-specific overloads from builtins. // function_family b (m, "builtin"); - b[".concat"] = [](project_name n, string s) + b[".concat"] += [](project_name n, string s) { string r (move (n).string ()); r += s; return r; }; - b[".concat"] = [](string s, project_name n) + b[".concat"] += [](string s, project_name n) { s += n.string (); return s; }; - b[".concat"] = [](project_name n, names ns) + b[".concat"] += [](project_name n, names ns) { string r (move (n).string ()); r += convert (move (ns)); return r; }; - b[".concat"] = [](names ns, project_name n) + b[".concat"] += [](names ns, project_name n) { string r (convert (move (ns))); r += n.string (); -- cgit v1.1