KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
utility.hpp
1// This file is part of KaMPIng.
2//
3// Copyright 2024 The KaMPIng Authors
4//
5// KaMPIng is free software : you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
7// version. KaMPIng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
8// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
9// for more details.
10//
11// You should have received a copy of the GNU Lesser General Public License along with KaMPIng. If not, see
12// <https://www.gnu.org/licenses/>.
13//
14#pragma once
15
16#include <utility>
17
19
20namespace kamping {
21/// @brief Specialization of the `mpi_type_traits` type trait for `std::pair`, which represents the pair as a sequence
22/// of bytes.
23/// @warning This is UB, because byte serialization is only well-defined for trivially copyable types. For a safe
24/// version see \ref kamping/types/utility.hpp.
25template <typename First, typename Second>
27 std::pair<First, Second>,
28 std::enable_if_t<has_static_type_v<First> && has_static_type_v<Second>>>
29 : byte_serialized<std::pair<First, Second>> {};
30} // namespace kamping
Utility that maps C++ types to types that can be understood by MPI.
STL namespace.
Constructs a type that is serialized as a sequence of sizeof(T) bytes using MPI_BYTE....
Definition mpi_datatype.hpp:83
The type trait that maps a C++ type T to a type trait that can be used to construct an MPI_Datatype.
Definition mpi_datatype.hpp:203