SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
type_pack_algorithm.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <concepts>
13#include <type_traits>
14#include <utility>
15
17
18namespace seqan3::detail
19{
20
21//-----------------------------------------------------------------------------
22// all_of
23//-----------------------------------------------------------------------------
24
55template <typename unary_predicate_t, typename... pack_t>
56 requires (std::predicate<unary_predicate_t, pack_t> && ...)
57constexpr bool all_of(unary_predicate_t && fn, pack_t &&... args)
58{
59 return (fn(std::forward<pack_t>(args)) && ...);
60}
61
62//-----------------------------------------------------------------------------
63// for_each
64//-----------------------------------------------------------------------------
65
93template <typename unary_function_t, typename... pack_t>
94 requires (std::invocable<unary_function_t, pack_t> && ...)
95constexpr void for_each(unary_function_t && fn, pack_t &&... args)
96{
97 (fn(std::forward<pack_t>(args)), ...);
98}
99
100} // namespace seqan3::detail
T all_of(T... args)
T for_each(T... args)
Provides platform and dependency checks.
Hide me