aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/prerequisite.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-12-13 22:03:02 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-12-15 12:45:07 +0300
commitb3b14171766089890b9e1b44935ed5dbc233c5f8 (patch)
treeb3f0d1471fe5c28187a0d5db0a6eae3822516e7a /libbuild2/prerequisite.hxx
parent3ca670b7b7c71ca67d70cac9dffb2ba6120b2e36 (diff)
Add noexcept to move constructors and move assignment operators
Diffstat (limited to 'libbuild2/prerequisite.hxx')
-rw-r--r--libbuild2/prerequisite.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/libbuild2/prerequisite.hxx b/libbuild2/prerequisite.hxx
index 33efed0..2f63056 100644
--- a/libbuild2/prerequisite.hxx
+++ b/libbuild2/prerequisite.hxx
@@ -63,6 +63,8 @@ namespace build2
// Note that the lookup is often ad hoc (see bin.whole as an example).
// But see also parser::lookup_variable() if adding something here.
//
+ // @@ PERF: redo as vector so can make move constructor noexcept.
+ //
public:
variable_map vars;
@@ -138,7 +140,10 @@ namespace build2
is_a (const target_type_type& tt) const {return type.is_a (tt);}
public:
- prerequisite (prerequisite&& x)
+ // Note that we have the noexcept specification even though vars
+ // (std::map) could potentially throw.
+ //
+ prerequisite (prerequisite&& x) noexcept
: proj (move (x.proj)),
type (x.type),
dir (move (x.dir)),
@@ -147,7 +152,8 @@ namespace build2
ext (move (x.ext)),
scope (x.scope),
target (x.target.load (memory_order_relaxed)),
- vars (move (x.vars), *this, false /* shared */) {}
+ vars (move (x.vars), *this, false /* shared */)
+ {}
prerequisite (const prerequisite& x, memory_order o = memory_order_consume)
: proj (x.proj),