From a2bd9cfdca9bb552f624d846bf6d916d35406fda Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 3 Apr 2018 14:43:55 -0600 Subject: [PATCH] Use dynamic_unique_cast() where appropriate. --- source/fe/mapping_q.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/source/fe/mapping_q.cc b/source/fe/mapping_q.cc index 007f13a469..9fd1fbc34a 100644 --- a/source/fe/mapping_q.cc +++ b/source/fe/mapping_q.cc @@ -13,6 +13,7 @@ // // --------------------------------------------------------------------- +#include #include #include #include @@ -158,12 +159,13 @@ MappingQ::get_data (const UpdateFlags update_flags, quadrature); if (!use_mapping_q_on_all_cells) - data->mapping_q1_data.reset (dynamic_cast::InternalData *> - (q1_mapping->get_data (update_flags, quadrature).release())); + data->mapping_q1_data = dynamic_unique_cast::InternalData> + (std::move(q1_mapping->get_data (update_flags, quadrature))); // wait for the task above to finish and use returned value - data->mapping_qp_data.reset (dynamic_cast::InternalData *> - (do_get_data.return_value().release())); + data->mapping_qp_data = dynamic_unique_cast::InternalData> + (std::move(do_get_data.return_value())); + return std::move(data); } @@ -184,12 +186,12 @@ MappingQ::get_face_data (const UpdateFlags update_flags, quadrature); if (!use_mapping_q_on_all_cells) - data->mapping_q1_data.reset (dynamic_cast::InternalData *> - (q1_mapping->get_face_data (update_flags, quadrature).release())); + data->mapping_q1_data = dynamic_unique_cast::InternalData> + (std::move(q1_mapping->get_face_data (update_flags, quadrature))); // wait for the task above to finish and use returned value - data->mapping_qp_data.reset (dynamic_cast::InternalData *> - (do_get_data.return_value().release())); + data->mapping_qp_data = dynamic_unique_cast::InternalData> + (std::move(do_get_data.return_value())); return std::move(data); } @@ -210,12 +212,12 @@ MappingQ::get_subface_data (const UpdateFlags update_flags, quadrature); if (!use_mapping_q_on_all_cells) - data->mapping_q1_data.reset (dynamic_cast::InternalData *> - (q1_mapping->get_subface_data (update_flags, quadrature).release())); + data->mapping_q1_data = dynamic_unique_cast::InternalData> + (std::move(q1_mapping->get_subface_data (update_flags, quadrature))); // wait for the task above to finish and use returned value - data->mapping_qp_data.reset (dynamic_cast::InternalData *> - (do_get_data.return_value().release())); + data->mapping_qp_data = dynamic_unique_cast::InternalData> + (std::move(do_get_data.return_value())); return std::move(data); } -- 2.39.5