aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/variable.ixx')
-rw-r--r--build2/variable.ixx9
1 files changed, 9 insertions, 0 deletions
diff --git a/build2/variable.ixx b/build2/variable.ixx
index 8656a04..04cf6dc 100644
--- a/build2/variable.ixx
+++ b/build2/variable.ixx
@@ -193,6 +193,15 @@ namespace build2
cast_false (const lookup& l) {return l && cast<T> (l);}
template <typename T>
+ inline T
+ cast_true (const value& v) {return !v || cast<T> (v);}
+
+ template <typename T>
+ inline T
+ cast_true (const lookup& l) {return !l || cast<T> (l);}
+
+
+ template <typename T>
inline void
typify (value& v, const variable& var)
{