From db2a696f810e41189bcdf5524696ff3d0cfbe5a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Feb 2017 11:40:07 +0200 Subject: Use target:as<> instead of static_cast for target casting --- build2/install/rule.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'build2/install/rule.cxx') diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index 3be7eef..3a5bd3d 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -614,7 +614,7 @@ namespace build2 target_state file_rule:: perform_install (action a, const target& xt) const { - const file& t (static_cast (xt)); + const file& t (xt.as ()); assert (!t.path ().empty ()); // Should have been assigned by update. auto install_target = [this] (const file& t, const path& p, bool verbose) @@ -663,7 +663,7 @@ namespace build2 for (const target* m (t.member); m != nullptr; m = m->member) { if (const path* p = lookup_install (*m, "install")) - install_target (static_cast (*m), *p, false); + install_target (m->as (), *p, false); } // Finally install the target itself (since we got here we know the @@ -872,7 +872,7 @@ namespace build2 target_state file_rule:: perform_uninstall (action a, const target& xt) const { - const file& t (static_cast (xt)); + const file& t (xt.as ()); assert (!t.path ().empty ()); // Should have been assigned by update. auto uninstall_target = [this] ( @@ -930,9 +930,8 @@ namespace build2 for (const target* m (t.member); m != nullptr; m = m->member) { if (const path* p = lookup_install (*m, "install")) - r |= uninstall_target (static_cast (*m), - *p, - r != target_state::changed); + r |= uninstall_target ( + m->as (), *p, r != target_state::changed); } // Finally handle installable prerequisites. -- cgit v1.1