aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.txx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/variable.txx')
-rw-r--r--build2/variable.txx22
1 files changed, 22 insertions, 0 deletions
diff --git a/build2/variable.txx b/build2/variable.txx
index 1373948..f75ffd6 100644
--- a/build2/variable.txx
+++ b/build2/variable.txx
@@ -6,6 +6,28 @@
namespace build2
{
+ template <typename T>
+ bool lookup::
+ belongs (const T& x, bool t) const
+ {
+ if (vars == &x.vars)
+ return true;
+
+ if (t)
+ {
+ for (const auto& p1: x.target_vars) // variable_type_map
+ {
+ for (const auto& p2: p1.second) // variable_pattern_map
+ {
+ if (vars == &p2.second)
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
// This one will be SFINAE'd out unless T is a simple value.
//
template <typename T>