diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-28 09:45:20 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-28 16:03:35 +0200 |
commit | 69801c4e23f877359118e55ed291737f4fbece04 (patch) | |
tree | cd4cb504a5c28aafde601e2d5d4603a44c75b548 /build2/variable.ixx | |
parent | 3ce44330cca9dbc4314feebb27403ebc3175b6c2 (diff) |
Add variable cast from lookup
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 a129835..8a03996 100644 --- a/build2/variable.ixx +++ b/build2/variable.ixx @@ -104,6 +104,20 @@ namespace build2 } template <typename T> + inline T& + cast (const lookup<value>& l) + { + return cast<T> (*l); + } + + template <typename T> + inline const T& + cast (const lookup<const value>& l) + { + return cast<T> (*l); + } + + template <typename T> inline void typify (value& v, const variable& var) { |