News
Shop
Learn
Community
Ein Bild oder sowas
LUCIDAC Documentation
User Docs
Pybrid
Julia
C++
Firmware
REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
helpers.h
Go to the documentation of this file.
1
// Copyright (c) 2024 anabrid GmbH
2
// Contact: https://www.anabrid.com/licensing/
3
//
4
// SPDX-License-Identifier: MIT OR GPL-2.0-or-later
5
6
#pragma once
7
8
#include <tuple>
9
10
// Helper to check if all values in a tuple are unique
11
template
<
typename
Tuple, std::size_t... Is>
12
constexpr
bool
all_unique_impl
(
const
Tuple& t, std::index_sequence<Is...>) {
13
return
((std::get<Is>(t) != std::get<Is + 1>(t)) && ...);
14
}
15
16
template
<
typename
... Args>
17
constexpr
bool
all_unique
(
const
std::tuple<Args...>& t) {
18
return
all_unique_impl
(t, std::make_index_sequence<
sizeof
...(Args) - 1>{});
19
}
all_unique
constexpr bool all_unique(const std::tuple< Args... > &t)
Definition
helpers.h:17
all_unique_impl
constexpr bool all_unique_impl(const Tuple &t, std::index_sequence< Is... >)
Definition
helpers.h:12
lib
controller
src
utils
helpers.h
Generated by
1.12.0