Skip to content

Commit b596dcd

Browse files
committed
Simplify has_mpi_type implementation
1 parent 116b5ec commit b596dcd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

c++/mpi/datatypes.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,10 @@ namespace mpi {
9696
/**
9797
* @brief Type trait to check if a type `T` has a corresponding MPI datatype, i.e. if mpi::mpi_type has been
9898
* specialized.
99-
* @tparam `T` Type to be checked.
100-
*/
101-
template <typename T, typename = void> constexpr bool has_mpi_type = false;
102-
103-
/**
104-
* @brief Specialization of mpi::has_mpi_type for types which have a corresponding MPI datatype.
99+
*
105100
* @tparam T Type to be checked.
106101
*/
107-
template <typename T> constexpr bool has_mpi_type<T, std::void_t<decltype(mpi_type<T>::get())>> = true;
102+
template <typename T> constexpr bool has_mpi_type = requires { mpi_type<T>::get(); };
108103

109104
namespace detail {
110105

0 commit comments

Comments
 (0)