Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
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) 2015 - 2021 by 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// individual authors of this file include:
23// silviana amethyst, university of wisconsin-eau claire
24//
25
26// detail/is_template_parameter.hpp
27
28
34
35#pragma once
37
38namespace bertini {
39
40 namespace detail{
41
45 template <typename...>
47 static constexpr bool value = false;
48 };
49
53 template <typename F, typename S, typename... T>
54 struct IsTemplateParameter<F, S, T...> {
55 static constexpr bool value =
56 std::is_same<F, S>::value || IsTemplateParameter<F, T...>::value;
57 // either it is the same as the first one in the pack, or we need to expand to the right in the pack.
58 };
59
60
61 template < typename T, typename ...Ts>
62 struct IsTemplateParameter<T, TypeList<Ts...>>
63 {
64 static constexpr bool value = IsTemplateParameter<T, Ts...>::value;
65 };
66
67
68
69 } // namespace detail
70
71
72}
Definition is_template_parameter.hpp:46
A basic typelist, in the style of Modern C++ Design, but using variadic templates.
Definition typelist.hpp:46
Contains the detail/typelist helper type, for templated getting/setting/storage of config structs.