aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/adhoc-rule-buildscript.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-18 10:03:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-19 04:12:34 +0200
commit095583f1fbab20937720f9311ddb9945ff2b9224 (patch)
tree5b97f4e4652111624175d9d137fe3b0e9837f7f4 /libbuild2/adhoc-rule-buildscript.cxx
parent9920e41e1372229c52f74151af5f1570f32a489c (diff)
Switch recipe from std::function to butl::move_only_function_ex
Diffstat (limited to 'libbuild2/adhoc-rule-buildscript.cxx')
-rw-r--r--libbuild2/adhoc-rule-buildscript.cxx34
1 files changed, 4 insertions, 30 deletions
diff --git a/libbuild2/adhoc-rule-buildscript.cxx b/libbuild2/adhoc-rule-buildscript.cxx
index 78891b9..aa30552 100644
--- a/libbuild2/adhoc-rule-buildscript.cxx
+++ b/libbuild2/adhoc-rule-buildscript.cxx
@@ -770,23 +770,10 @@ namespace build2
mdb->bs = &bs;
mdb->mt = update ? timestamp_nonexistent : mt;
- // @@ TMP: re-enable once recipe becomes move_only_function.
- //
-#if 0
- return [this, md = move (mdb)] (action a, const target& t) mutable
- {
- auto r (perform_update_file_dyndep_byproduct (a, t, *md));
- md.reset (); // @@ TMP: is this really necessary (+mutable)?
- return r;
- };
-#else
- t.data (move (mdb));
- return recipe ([this] (action a, const target& t) mutable
+ return [this, md = move (mdb)] (action a, const target& t)
{
- auto md (move (t.data<unique_ptr<match_data_byproduct>> ()));
return perform_update_file_dyndep_byproduct (a, t, *md);
- });
-#endif
+ };
}
else
{
@@ -819,23 +806,10 @@ namespace build2
md->mt = update ? timestamp_nonexistent : mt;
md->deferred_failure = deferred_failure;
- // @@ TMP: re-enable once recipe becomes move_only_function.
- //
-#if 0
- return [this, md = move (md)] (action a, const target& t) mutable
- {
- auto r (perform_update_file_dyndep (a, t, *md));
- md.reset (); // @@ TMP: is this really necessary (+mutable)?
- return r;
- };
-#else
- t.data (move (md));
- return recipe ([this] (action a, const target& t) mutable
+ return [this, md = move (md)] (action a, const target& t)
{
- auto md (move (t.data<unique_ptr<match_data>> ()));
return perform_update_file_dyndep (a, t, *md);
- });
-#endif
+ };
}
}