aboutsummaryrefslogtreecommitdiff
path: root/build2/scope.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/scope.ixx')
-rw-r--r--build2/scope.ixx12
1 files changed, 12 insertions, 0 deletions
diff --git a/build2/scope.ixx b/build2/scope.ixx
index 9a93e9d..ac71e82 100644
--- a/build2/scope.ixx
+++ b/build2/scope.ixx
@@ -39,4 +39,16 @@ namespace build2
for (; r->parent_->root_ != nullptr; r = r->parent_->root_) ;
return r;
}
+
+ inline bool scope::
+ sub_root (const scope& r) const
+ {
+ // Scan the parent root scope chain looking for this scope.
+ //
+ for (const scope* pr (&r); (pr = pr->parent_->root_) != nullptr; )
+ if (pr == this)
+ return true;
+
+ return false;
+ }
}