Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
is_template_parameter.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//is_template_parameter.hpp is free software: you can redistribute it and/or modify
4//it under the terms of the GNU General Public License as published by
5//the Free Software Foundation, either version 3 of the License, or
6//(at your option) any later version.
7//
8//is_template_parameter.hpp is distributed in the hope that it will be useful,
9//but WITHOUT ANY WARRANTY; without even the implied warranty of
10//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11//GNU General Public License for more details.
12//
13//You should have received a copy of the GNU General Public License
14//along with is_template_parameter.hpp. If not, see <http://www.gnu.org/licenses/>.
15//
16// Copyright(C) Bertini2 Development Team
17//
18// See <http://www.gnu.org/licenses/> for a copy of the license,
19// as well as COPYING. Bertini2 is provided with permitted
20// additional terms in the b2/licenses/ directory.
21
22// detail/is_template_parameter.hpp
23
24
30
31#pragma once
33
34namespace bertini {
35
36 namespace detail{
37
41 template <typename...>
43 static constexpr bool value = false;
44 };
45
49 template <typename F, typename S, typename... T>
50 struct IsTemplateParameter<F, S, T...> {
51 static constexpr bool value =
52 std::is_same<F, S>::value || IsTemplateParameter<F, T...>::value;
53 // either it is the same as the first one in the pack, or we need to expand to the right in the pack.
54 };
55
56
58 template < typename T, typename ...Ts>
59 struct IsTemplateParameter<T, TypeList<Ts...>>
60 {
61 static constexpr bool value = IsTemplateParameter<T, Ts...>::value;
62 };
63
64
65
66 } // namespace detail
67
68
69}
Definition configured.hpp:34
Definition algorithm_builder.hpp:36
static constexpr bool value
Whether F appears in the pack.
Definition is_template_parameter.hpp:51
static constexpr bool value
Whether T appears in the TypeList.
Definition is_template_parameter.hpp:61
Base template, which says 'no', it's not in the pack.
Definition is_template_parameter.hpp:42
static constexpr bool value
Whether the queried type appears in the pack (base case: no).
Definition is_template_parameter.hpp:43
A basic typelist, in the style of Modern C++ Design, but using variadic templates.
Definition typelist.hpp:42
Contains the detail/typelist helper type, for templated getting/setting/storage of config structs.