From: Wolfgang Bangerth Date: Tue, 15 Feb 2022 22:22:38 +0000 (-0700) Subject: Explicitly delete a function that we don't want to be called. X-Git-Tag: v9.4.0-rc1~485^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13393%2Fhead;p=dealii.git Explicitly delete a function that we don't want to be called. --- diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index 77ea392a58..e51f625250 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -139,22 +139,6 @@ namespace Utilities */ namespace MPI { -#ifdef DOXYGEN - /** - * Given a pointer to an object of class T, return the matching - * `MPI_Datatype` to be used for MPI communication. - * - * As an example, passing an `int*` to this function returns `MPI_INT`. - * - * @note In reality, these functions are not template functions templated - * on the parameter T, but free standing inline function overloads. This - * templated version only exists so that it shows up in the documentation. - */ - template - MPI_Datatype - mpi_type_id(const T *); -#endif - /** * Return the number of MPI processes there exist in the given * @ref GlossMPICommunicator "communicator" @@ -1327,10 +1311,27 @@ namespace Utilities -#ifndef DOXYGEN - /* --------------------------- inline functions ------------------------- */ + /** + * Given a pointer to an object of class T, return the matching + * `MPI_Datatype` to be used for MPI communication. + * + * As an example, passing an `int*` to this function returns `MPI_INT`. + * + * @note In reality, these functions are not template functions templated + * on the parameter T, but free standing inline function overloads. This + * templated version only exists so that it shows up in the documentation. + * The `=delete` statement at the end of the declaration ensures that the + * compiler will never choose this general template and instead look + * for one of the overloads. + */ + template + inline MPI_Datatype + mpi_type_id(const T *) = delete; + +#ifndef DOXYGEN + # ifdef DEAL_II_WITH_MPI inline MPI_Datatype mpi_type_id(const bool *)