From: Matthias Maier Date: Wed, 27 May 2015 10:53:58 +0000 (+0200) Subject: Workaround for a regression in <=gcc-4.7 with partial template default values X-Git-Tag: v8.3.0-rc1~150^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e88a7faa61173f0f02fde94b5f4034532a1f4ed4;p=dealii.git Workaround for a regression in <=gcc-4.7 with partial template default values --- diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index 834f7934de..ce1145ebd0 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -2143,10 +2143,19 @@ operator*(const PackagedOperation &comp, * * @ingroup LAOperators */ + +// workaround for a bug in <=gcc-4.7 that does not like partial template +// default values in combination with local lambda expressions [1] +// [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53624 template , typename Domain = Range, typename BlockMatrix> LinearOperator +lower_triangular_operator(const BlockMatrix &); + + +template +LinearOperator lower_triangular_operator(const BlockMatrix &block_matrix) { Assert( block_matrix.n_block_rows() == block_matrix.n_block_cols(), @@ -2258,10 +2267,19 @@ lower_triangular_operator(const BlockMatrix &block_matrix) * * @ingroup LAOperators */ + +// workaround for a bug in <=gcc-4.7 that does not like partial template +// default values in combination with local lambda expressions [1] +// [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53624 template , typename Domain = Range, typename BlockMatrix> LinearOperator +upper_triangular_operator(const BlockMatrix &); + + +template +LinearOperator upper_triangular_operator(const BlockMatrix &block_matrix) { Assert( block_matrix.n_block_rows() == block_matrix.n_block_cols(), @@ -2378,13 +2396,24 @@ upper_triangular_operator(const BlockMatrix &block_matrix) * to use upper triangular part of @p block_matrix (false). * @ingroup LAOperators */ + +// workaround for a bug in <=gcc-4.7 that does not like partial template +// default values in combination with local lambda expressions [1] +// [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53624 template , typename Domain = Range, typename BlockMatrix> LinearOperator -block_triangular_inverse( const BlockMatrix &block_matrix, - const LinearOperator &inverse_diagonal, - bool lower = true) +block_triangular_inverse(const BlockMatrix &, + const LinearOperator &, + bool lower = true); + + +template +LinearOperator +block_triangular_inverse(const BlockMatrix &block_matrix, + const LinearOperator &inverse_diagonal, + bool lower) { Assert( block_matrix.n_block_rows() == block_matrix.n_block_cols(), ExcDimensionMismatch(block_matrix.n_block_rows(),block_matrix.n_block_cols()) );