]> https://gitweb.dealii.org/ - dealii.git/commitdiff
reformat 7259/head
authorTimo Heister <timo.heister@gmail.com>
Wed, 3 Oct 2018 13:37:57 +0000 (09:37 -0400)
committerTimo Heister <timo.heister@gmail.com>
Wed, 3 Oct 2018 13:40:16 +0000 (09:40 -0400)
include/deal.II/base/mpi.h

index aa9b0b4bbc190ef3f78148901e1e495127b8c945..359208c7d1732197ac38b4505f93b15c6d9b1c1a 100644 (file)
@@ -49,24 +49,27 @@ using MPI_Op       = int;
 
 
 
-// Helper macro to remove const from the pointer arguments to some MPI_*
-// functions.
-//
-// This is needed as the input arguments of functions like MPI_Allgather() are
-// not marked as const in OpenMPI 1.6.5.
+/** Helper macro to remove const from the pointer arguments to some MPI_*
+ * functions.
+ *
+ * This is needed as the input arguments of functions like MPI_Allgather() are
+ * not marked as const in OpenMPI 1.6.5. If using MPI 3 or newer, this macro
+ * is a NOOP, while we do the following otherwise:
+ *
+ * 1. remove * from type of @p expr
+ * 2. remove const from resulting type
+ * 3. add * to resulting type
+ * 4. const_cast the given expression @p expr to this new type.
+ */
 #ifdef DEAL_II_WITH_MPI
 #  if DEAL_II_MPI_VERSION_GTE(3, 0)
-// We are good, no casts are needed.
+
 #    define DEAL_II_MPI_CONST_CAST(expr) (expr)
+
 #  else
 
 #    include <type_traits>
 
-// This monster of a macro will:
-// 1. remove *
-// 2. remove const
-// 3. add *
-// 4. const_cast the given expression to this new type.
 #    define DEAL_II_MPI_CONST_CAST(expr)                                       \
       const_cast<                                                              \
         std::remove_const<std::remove_pointer<decltype(expr)>::type>::type *>( \

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.