aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-20 15:56:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-20 15:56:26 +0200
commit5058b155076b004f4abf21be6cf657a3f2cc4d1b (patch)
tree2a1675598de93c22ef9850996cfd2964fb11480c /build2/variable.ixx
parentc9c366bc5f77a806384ebf678fe4335c1422884c (diff)
Add support for not cleaning generated version file
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)
{