KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
tuple.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 <tuple>
17
19
20namespace kamping {
21/// @brief Specialization of the `mpi_type_traits` type trait for `std::tuple`, which represents the tuple 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/tuple.hpp.
25template <typename... Ts>
26struct mpi_type_traits<std::tuple<Ts...>, std::enable_if_t<(has_static_type_v<Ts> && ...)>>
27 : byte_serialized<std::tuple<Ts...>> {};
28} // namespace kamping
Utility that maps C++ types to types that can be understood by MPI.
STL namespace.