From: David Wells Date: Mon, 8 Jun 2015 03:20:14 +0000 (-0400) Subject: Replace std::auto_ptr with std_cxx11::unique_ptr. X-Git-Tag: v8.3.0-rc1~123^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be4fd28ae303f325d6426139edd6dc6acec7ae86;p=dealii.git Replace std::auto_ptr with std_cxx11::unique_ptr. std::auto_ptr has been deprecated by new C++ standards. The official replacement is std::unique_ptr. --- diff --git a/include/deal.II/base/parameter_handler.h b/include/deal.II/base/parameter_handler.h index 3de60c39d2..860eb5b5ae 100644 --- a/include/deal.II/base/parameter_handler.h +++ b/include/deal.II/base/parameter_handler.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -28,7 +29,6 @@ #include #include #include -#include DEAL_II_NAMESPACE_OPEN @@ -1952,7 +1952,7 @@ private: * than having to include all of the property_tree stuff from boost. This * works around a problem with gcc 4.5. */ - std::auto_ptr entries; + std_cxx11::unique_ptr entries; /** * A list of patterns that are used to describe the parameters of this diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index c880b747a6..25cc72a436 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,6 @@ #include #include -#include // dummy include in order to have the // definition of PetscScalar available @@ -2469,7 +2469,7 @@ protected: * is necessary for the get_function_* functions as well as the * functions of same name in the extractor classes. */ - std::auto_ptr present_cell; + std_cxx11::unique_ptr present_cell; /** * A signal connection we use to ensure we get informed whenever the diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 1e3e8857db..1acc1dc3f0 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -33,7 +33,7 @@ DEAL_II_NAMESPACE_OPEN //TODO[WB]: do not use a plain pointer for DoFHandler::faces, but rather an -//auto_ptr or some such thing. alternatively, why not use the DoFFaces object +//unique_ptr or some such thing. alternatively, why not use the DoFFaces object //right away? template diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 44751451d6..f0eed20193 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -3427,14 +3428,14 @@ FEValues::initialize (const UpdateFlags update_flags) namespace { - // Reset a std::auto_ptr. If we can, do not de-allocate the previously + // Reset a unique_ptr. If we can, do not de-allocate the previously // held memory but re-use it for the next item to avoid the repeated // memory allocation. We do this because FEValues objects are heavily // used in multithreaded contexts where memory allocations are evil. template void reset_pointer_in_place_if_possible - (std::auto_ptr &present_cell, + (std_cxx11::unique_ptr &present_cell, const Iterator &new_cell) { // see if the existing pointer is non-null and if the type of diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index b636a38ead..a218480ab7 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include -#include #include @@ -782,7 +782,7 @@ transform_unit_to_real_cell (const typename Triangulation::cell_it update_internal_dofs(cell); const Quadrature point_quadrature(p); - std::auto_ptr + std_cxx11::unique_ptr mdata (dynamic_cast ( get_data(update_transformation_values, point_quadrature))); @@ -844,7 +844,7 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it UpdateFlags update_flags = update_transformation_values|update_transformation_gradients; if (spacedim>dim) update_flags |= update_jacobian_grads; - std::auto_ptr + std_cxx11::unique_ptr mdata (dynamic_cast ( get_data(update_flags,point_quadrature))); diff --git a/source/fe/mapping_q.cc b/source/fe/mapping_q.cc index 79d53e46d9..9065f1ece1 100644 --- a/source/fe/mapping_q.cc +++ b/source/fe/mapping_q.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include -#include DEAL_II_NAMESPACE_OPEN @@ -1036,7 +1036,7 @@ transform_unit_to_real_cell (const typename Triangulation::cell_it // the right size and transformation shape values already computed at point // p. const Quadrature point_quadrature(p); - std::auto_ptr + std_cxx11::unique_ptr mdata (dynamic_cast ( get_data(update_transformation_values, point_quadrature))); @@ -1122,7 +1122,7 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it UpdateFlags update_flags = update_transformation_values|update_transformation_gradients; if (spacedim>dim) update_flags |= update_jacobian_grads; - std::auto_ptr + std_cxx11::unique_ptr mdata (dynamic_cast ( get_data(update_flags,point_quadrature))); diff --git a/source/fe/mapping_q1.cc b/source/fe/mapping_q1.cc index 77bbb34aa9..5927a3e70e 100644 --- a/source/fe/mapping_q1.cc +++ b/source/fe/mapping_q1.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include -#include DEAL_II_NAMESPACE_OPEN @@ -1433,7 +1433,7 @@ MappingQ1::transform_unit_to_real_cell ( // already computed at point p. const Quadrature point_quadrature(p); - std::auto_ptr + std_cxx11::unique_ptr mdata (dynamic_cast ( get_data(update_transformation_values, point_quadrature))); @@ -1669,7 +1669,7 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it if (spacedim>dim) update_flags |= update_jacobian_grads; - std::auto_ptr + std_cxx11::unique_ptr mdata(dynamic_cast ( MappingQ1::get_data(update_flags, point_quadrature))); diff --git a/tests/bits/fe_tools_05.cc b/tests/bits/fe_tools_05.cc index 75b0200a41..f2d5528e9b 100644 --- a/tests/bits/fe_tools_05.cc +++ b/tests/bits/fe_tools_05.cc @@ -45,9 +45,9 @@ check_this (const FiniteElement &fe1, if (!fe2.constraints_are_implemented()) return; - std::auto_ptr > tria(make_tria()); - std::auto_ptr > dof1(make_dof_handler (*tria, fe1)); - std::auto_ptr > dof2(make_dof_handler (*tria, fe2)); + std_cxx11::unique_ptr > tria(make_tria()); + std_cxx11::unique_ptr > dof1(make_dof_handler (*tria, fe1)); + std_cxx11::unique_ptr > dof2(make_dof_handler (*tria, fe2)); ConstraintMatrix cm; DoFTools::make_hanging_node_constraints (*dof2, cm); cm.close (); diff --git a/tests/bits/fe_tools_06.cc b/tests/bits/fe_tools_06.cc index 1182fcec48..24f3eddae9 100644 --- a/tests/bits/fe_tools_06.cc +++ b/tests/bits/fe_tools_06.cc @@ -46,9 +46,9 @@ check_this (const FiniteElement &fe1, !fe2.constraints_are_implemented()) return; - std::auto_ptr > tria(make_tria()); - std::auto_ptr > dof1(make_dof_handler (*tria, fe1)); - std::auto_ptr > dof2(make_dof_handler (*tria, fe2)); + std_cxx11::unique_ptr > tria(make_tria()); + std_cxx11::unique_ptr > dof1(make_dof_handler (*tria, fe1)); + std_cxx11::unique_ptr > dof2(make_dof_handler (*tria, fe2)); ConstraintMatrix cm1, cm2; DoFTools::make_hanging_node_constraints (*dof1, cm1); DoFTools::make_hanging_node_constraints (*dof2, cm2); diff --git a/tests/bits/fe_tools_06b.cc b/tests/bits/fe_tools_06b.cc index f2c2edf48f..2c8cccd0da 100644 --- a/tests/bits/fe_tools_06b.cc +++ b/tests/bits/fe_tools_06b.cc @@ -47,9 +47,9 @@ check_this (const FiniteElement &fe1, !fe2.constraints_are_implemented()) return; - std::auto_ptr > tria(make_tria()); - std::auto_ptr > dof1(make_dof_handler (*tria, fe1)); - std::auto_ptr > dof2(make_dof_handler (*tria, fe2)); + std_cxx11::unique_ptr > tria(make_tria()); + std_cxx11::unique_ptr > dof1(make_dof_handler (*tria, fe1)); + std_cxx11::unique_ptr > dof2(make_dof_handler (*tria, fe2)); ConstraintMatrix cm1, cm2; DoFTools::make_hanging_node_constraints (*dof1, cm1); DoFTools::make_hanging_node_constraints (*dof2, cm2); diff --git a/tests/bits/fe_tools_07.cc b/tests/bits/fe_tools_07.cc index e2628c0e62..19414685d2 100644 --- a/tests/bits/fe_tools_07.cc +++ b/tests/bits/fe_tools_07.cc @@ -46,9 +46,9 @@ check_this (const FiniteElement &fe1, !fe2.constraints_are_implemented()) return; - std::auto_ptr > tria(make_tria()); - std::auto_ptr > dof1(make_dof_handler (*tria, fe1)); - std::auto_ptr > dof2(make_dof_handler (*tria, fe2)); + std_cxx11::unique_ptr > tria(make_tria()); + std_cxx11::unique_ptr > dof1(make_dof_handler (*tria, fe1)); + std_cxx11::unique_ptr > dof2(make_dof_handler (*tria, fe2)); ConstraintMatrix cm1, cm2; DoFTools::make_hanging_node_constraints (*dof1, cm1); DoFTools::make_hanging_node_constraints (*dof2, cm2); diff --git a/tests/bits/fe_tools_08.cc b/tests/bits/fe_tools_08.cc index f48ddff644..d6540607f2 100644 --- a/tests/bits/fe_tools_08.cc +++ b/tests/bits/fe_tools_08.cc @@ -51,9 +51,9 @@ check_this (const FiniteElement &fe1, if (!fe2.isotropic_restriction_is_implemented()) return; - std::auto_ptr > tria(make_tria()); - std::auto_ptr > dof1(make_dof_handler (*tria, fe1)); - std::auto_ptr > dof2(make_dof_handler (*tria, fe2)); + std_cxx11::unique_ptr > tria(make_tria()); + std_cxx11::unique_ptr > dof1(make_dof_handler (*tria, fe1)); + std_cxx11::unique_ptr > dof2(make_dof_handler (*tria, fe2)); ConstraintMatrix cm; DoFTools::make_hanging_node_constraints (*dof2, cm); cm.close (); diff --git a/tests/bits/fe_tools_common.h b/tests/bits/fe_tools_common.h index 635ea1feee..eab6fad810 100644 --- a/tests/bits/fe_tools_common.h +++ b/tests/bits/fe_tools_common.h @@ -18,6 +18,7 @@ #include "../tests.h" #include +#include #include #include #include @@ -37,7 +38,6 @@ #include #include #include -#include // forward declaration of the function that must be provided in the