From: Wolfgang Bangerth Date: Tue, 3 Apr 2018 20:43:55 +0000 (-0600) Subject: Use dynamic_unique_cast() where appropriate. X-Git-Tag: v9.0.0-rc1~222^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6174%2Fhead;p=dealii.git Use dynamic_unique_cast() where appropriate. --- 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); }