EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
is_contained.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file is_contained.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 namespace Acts {
12 namespace detail {
24 template <typename T, T target, T... values>
25 struct is_contained;
26 
28 template <typename T, T target, T... others>
29 struct is_contained<T, target, target, others...> {
30  enum { value = true };
31 };
32 
33 template <typename T, T target>
34 struct is_contained<T, target, target> {
35  enum { value = true };
36 };
37 
38 template <typename T, T target, T next, T... others>
39 struct is_contained<T, target, next, others...> {
40  enum { value = is_contained<T, target, others...>::value };
41 };
42 
43 template <typename T, T target, T next>
44 struct is_contained<T, target, next> {
45  enum { value = false };
46 };
48 } // namespace detail
50 } // namespace Acts