From: Daniel Arndt Date: Wed, 27 May 2020 03:14:18 +0000 (-0400) Subject: Simplify C++14 lambda initializers X-Git-Tag: v9.3.0-rc1~1545^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10379%2Fhead;p=dealii.git Simplify C++14 lambda initializers --- diff --git a/include/deal.II/lac/constrained_linear_operator.h b/include/deal.II/lac/constrained_linear_operator.h index 7adb3c4ccd..b258b48d19 100644 --- a/include/deal.II/lac/constrained_linear_operator.h +++ b/include/deal.II/lac/constrained_linear_operator.h @@ -128,16 +128,14 @@ distribute_constraints_linear_operator( v.compress(VectorOperation::add); }; - // lambda capture expressions are a C++14 feature... - const auto vmult_add = return_op.vmult_add; - return_op.vmult = [vmult_add](Range &v, const Domain &u) { + return_op.vmult = [vmult_add = return_op.vmult_add](Range & v, + const Domain &u) { v = 0.; vmult_add(v, u); }; - // lambda capture expressions are a C++14 feature... - const auto Tvmult_add = return_op.Tvmult_add; - return_op.Tvmult = [Tvmult_add](Domain &v, const Range &u) { + return_op.Tvmult = [Tvmult_add = return_op.Tvmult_add](Domain & v, + const Range &u) { v = 0.; Tvmult_add(v, u); }; @@ -193,16 +191,14 @@ project_to_constrained_linear_operator( v.compress(VectorOperation::add); }; - // lambda capture expressions are a C++14 feature... - const auto vmult_add = return_op.vmult_add; - return_op.vmult = [vmult_add](Range &v, const Domain &u) { + return_op.vmult = [vmult_add = return_op.vmult_add](Range & v, + const Domain &u) { v = 0.; vmult_add(v, u); }; - // lambda capture expressions are a C++14 feature... - const auto Tvmult_add = return_op.Tvmult_add; - return_op.Tvmult = [Tvmult_add](Domain &v, const Range &u) { + return_op.Tvmult = [Tvmult_add = return_op.Tvmult_add](Domain & v, + const Range &u) { v = 0.; Tvmult_add(v, u); }; @@ -318,9 +314,7 @@ constrained_right_hand_side( v += Ct * (right_hand_side - linop * *k); }; - // lambda capture expressions are a C++14 feature... - const auto apply_add = return_comp.apply_add; - return_comp.apply = [apply_add](Range &v) { + return_comp.apply = [apply_add = return_comp.apply_add](Range &v) { v = 0.; apply_add(v); };