diff options
Diffstat (limited to 'build2/variable.ixx')
-rw-r--r-- | build2/variable.ixx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/build2/variable.ixx b/build2/variable.ixx index 953bc86..991556a 100644 --- a/build2/variable.ixx +++ b/build2/variable.ixx @@ -201,6 +201,20 @@ namespace build2 template <typename T> inline T + cast_default (const value& v, const T& d) + { + return v ? cast<T> (v) : d; + } + + template <typename T> + inline T + cast_default (const lookup& l, const T& d) + { + return l ? cast<T> (l) : d; + } + + template <typename T> + inline T cast_false (const value& v) { return v && cast<T> (v); |