From 7a528eab1561b0d0d4ec29f98355fe67025ea632 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Nov 2016 11:56:00 +0200 Subject: Add support for derived-to-base function overload resolution --- build2/variable.ixx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'build2/variable.ixx') 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::value_type); - return *static_cast (v.type->cast == nullptr - ? static_cast (&v.data_) - : const_cast (v.type->cast (v, v.type))); + // Forward to const T&. + // + return const_cast (cast (static_cast (v))); } template -- cgit v1.1