diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-21 11:56:00 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-21 11:56:00 +0200 |
commit | 7a528eab1561b0d0d4ec29f98355fe67025ea632 (patch) | |
tree | 28a2061f17e3ee625e8674378227a81a8738a6ec /build2/variable.ixx | |
parent | 3db0756adc641e0a63c4c9f194c4f73cceddd90c (diff) |
Add support for derived-to-base function overload resolution
Diffstat (limited to 'build2/variable.ixx')
-rw-r--r-- | build2/variable.ixx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/build2/variable.ixx b/build2/variable.ixx index 1e9dfe6..4d70685 100644 --- a/build2/variable.ixx +++ b/build2/variable.ixx @@ -136,10 +136,9 @@ namespace build2 inline T& cast (value& v) { - assert (v && v.type == &value_traits<T>::value_type); - return *static_cast<T*> (v.type->cast == nullptr - ? static_cast<void*> (&v.data_) - : const_cast<void*> (v.type->cast (v, v.type))); + // Forward to const T&. + // + return const_cast<T&> (cast<T> (static_cast <const value&> (v))); } template <typename T> |