Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:55

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2018 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 namespace Acts::detail {
0011 
0012 namespace {
0013 template <typename... Args>
0014 struct has_duplicates;
0015 
0016 template <>
0017 struct has_duplicates<> {
0018   static constexpr bool value = false;
0019 };
0020 
0021 template <typename last>
0022 struct has_duplicates<last> {
0023   static constexpr bool value = false;
0024 };
0025 
0026 template <typename first, typename second, typename... others>
0027 struct has_duplicates<first, second, others...> {
0028  private:
0029   static constexpr bool _first = has_duplicates<first, others...>::value;
0030   static constexpr bool _second = has_duplicates<second, others...>::value;
0031 
0032  public:
0033   static constexpr bool value = _first || _second;
0034 };
0035 
0036 template <typename first, typename... others>
0037 struct has_duplicates<first, first, others...> {
0038   static constexpr bool value = true;
0039 };
0040 }  // namespace
0041 
0042 template <typename... Args>
0043 constexpr bool has_duplicates_v = has_duplicates<Args...>::value;
0044 }  // namespace Acts::detail