]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Workaround for a regression in <=gcc-4.7 with partial template default values
authorMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Wed, 27 May 2015 10:53:58 +0000 (12:53 +0200)
committerMatthias Maier <tamiko@43-1.org>
Wed, 27 May 2015 20:08:09 +0000 (22:08 +0200)
include/deal.II/lac/linear_operator.h

index 834f7934de8ed97b53a1e6bdfd42f3296bde2886..ce1145ebd0b9f9fb7677fe0b5295206d0d5c0586 100644 (file)
@@ -2143,10 +2143,19 @@ operator*(const PackagedOperation<Range> &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 Range = BlockVector<double>,
           typename Domain = Range,
           typename BlockMatrix>
 LinearOperator<Range, Domain>
+lower_triangular_operator(const BlockMatrix &);
+
+
+template <typename Range, typename Domain, typename BlockMatrix>
+LinearOperator<Range, Domain>
 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 Range = BlockVector<double>,
           typename Domain = Range,
           typename BlockMatrix>
 LinearOperator<Range, Domain>
+upper_triangular_operator(const BlockMatrix &);
+
+
+template <typename Range, typename Domain, typename BlockMatrix>
+LinearOperator<Range, Domain>
 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 Range = BlockVector<double>,
           typename Domain = Range,
           typename BlockMatrix>
 LinearOperator<Range, Domain>
-block_triangular_inverse( const BlockMatrix &block_matrix,
-                          const LinearOperator<Range, Domain> &inverse_diagonal,
-                          bool lower = true)
+block_triangular_inverse(const BlockMatrix &,
+                         const LinearOperator<Range, Domain> &,
+                         bool lower = true);
+
+
+template <typename Range, typename Domain, typename BlockMatrix>
+LinearOperator<Range, Domain>
+block_triangular_inverse(const BlockMatrix &block_matrix,
+                         const LinearOperator<Range, Domain> &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()) );

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.