From f4b04e6810918f6624d4d0e65a5ab85bdddbb157 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 27 Feb 2018 13:01:37 -0500 Subject: [PATCH] fix more findings of modernize-use-emplace --- examples/step-17/step-17.cc | 12 ++++++------ examples/step-18/step-18.cc | 12 ++++++------ examples/step-31/step-31.cc | 2 +- examples/step-32/step-32.cc | 8 ++++---- examples/step-33/step-33.cc | 10 +++++----- examples/step-43/step-43.cc | 4 ++-- examples/step-45/step-45.cc | 2 +- examples/step-55/step-55.cc | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/examples/step-17/step-17.cc b/examples/step-17/step-17.cc index 6bacda5732..a9e75d3377 100644 --- a/examples/step-17/step-17.cc +++ b/examples/step-17/step-17.cc @@ -954,16 +954,16 @@ namespace Step17 switch (dim) { case 1: - solution_names.push_back ("displacement"); + solution_names.emplace_back ("displacement"); break; case 2: - solution_names.push_back ("x_displacement"); - solution_names.push_back ("y_displacement"); + solution_names.emplace_back ("x_displacement"); + solution_names.emplace_back ("y_displacement"); break; case 3: - solution_names.push_back ("x_displacement"); - solution_names.push_back ("y_displacement"); - solution_names.push_back ("z_displacement"); + solution_names.emplace_back ("x_displacement"); + solution_names.emplace_back ("y_displacement"); + solution_names.emplace_back ("z_displacement"); break; default: Assert (false, ExcInternalError()); diff --git a/examples/step-18/step-18.cc b/examples/step-18/step-18.cc index 026ba3b3af..ac33fc07b8 100644 --- a/examples/step-18/step-18.cc +++ b/examples/step-18/step-18.cc @@ -1248,16 +1248,16 @@ namespace Step18 switch (dim) { case 1: - solution_names.push_back ("delta_x"); + solution_names.emplace_back ("delta_x"); break; case 2: - solution_names.push_back ("delta_x"); - solution_names.push_back ("delta_y"); + solution_names.emplace_back ("delta_x"); + solution_names.emplace_back ("delta_y"); break; case 3: - solution_names.push_back ("delta_x"); - solution_names.push_back ("delta_y"); - solution_names.push_back ("delta_z"); + solution_names.emplace_back ("delta_x"); + solution_names.emplace_back ("delta_y"); + solution_names.emplace_back ("delta_z"); break; default: Assert (false, ExcNotImplemented()); diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 8a5aa28a5d..3516584150 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -1950,7 +1950,7 @@ namespace Step31 return; std::vector stokes_names (dim, "velocity"); - stokes_names.push_back ("p"); + stokes_names.emplace_back ("p"); std::vector stokes_component_interpretation (dim+1, DataComponentInterpretation::component_is_scalar); diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index 68afe56909..b7750eda86 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -3185,10 +3185,10 @@ namespace Step32 BoussinesqFlowProblem::Postprocessor::get_names() const { std::vector solution_names (dim, "velocity"); - solution_names.push_back ("p"); - solution_names.push_back ("T"); - solution_names.push_back ("friction_heating"); - solution_names.push_back ("partition"); + solution_names.emplace_back ("p"); + solution_names.emplace_back ("T"); + solution_names.emplace_back ("friction_heating"); + solution_names.emplace_back ("partition"); return solution_names; } diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index b98589bdc1..cd9e10516e 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -129,8 +129,8 @@ namespace Step33 component_names () { std::vector names (dim, "momentum"); - names.push_back ("density"); - names.push_back ("energy_density"); + names.emplace_back ("density"); + names.emplace_back ("energy_density"); return names; } @@ -640,11 +640,11 @@ namespace Step33 { std::vector names; for (unsigned int d=0; d joint_solution_names (dim, "velocity"); - joint_solution_names.push_back ("pressure"); - joint_solution_names.push_back ("saturation"); + joint_solution_names.emplace_back ("pressure"); + joint_solution_names.emplace_back ("saturation"); std::vector data_component_interpretation diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index 2acf15a42f..145a88389f 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -657,7 +657,7 @@ namespace Step45 StokesProblem::output_results (const unsigned int refinement_cycle) const { std::vector solution_names (dim, "velocity"); - solution_names.push_back ("pressure"); + solution_names.emplace_back ("pressure"); std::vector data_component_interpretation diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index 4f399e5d0c..a3959328d9 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -732,7 +732,7 @@ namespace Step55 std::vector solution_names (dim, "velocity"); - solution_names.push_back ("pressure"); + solution_names.emplace_back ("pressure"); std::vector data_component_interpretation (dim, DataComponentInterpretation::component_is_part_of_vector); @@ -754,7 +754,7 @@ namespace Step55 interpolated_relevant = interpolated; { std::vector solution_names (dim, "ref_u"); - solution_names.push_back ("ref_p"); + solution_names.emplace_back ("ref_p"); data_out.add_data_vector (interpolated_relevant, solution_names, DataOut::type_dof_data, data_component_interpretation); -- 2.39.5