huangcm
2025-02-28 b45e871a67cd1272e3da9ba5bd383f832b0f1824
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 *  Created by Jozef on 12/11/2018.
 *  Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
#ifndef TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED
 
#include <type_traits>
 
namespace Catch{
 
#ifdef CATCH_CPP17_OR_GREATER
   template <typename...>
   inline constexpr auto is_unique = std::true_type{};
 
   template <typename T, typename... Rest>
   inline constexpr auto is_unique<T, Rest...> = std::bool_constant<
       (!std::is_same_v<T, Rest> && ...) && is_unique<Rest...>
   >{};
#else
 
template <typename...>
struct is_unique : std::true_type{};
 
template <typename T0, typename T1, typename... Rest>
struct is_unique<T0, T1, Rest...> : std::integral_constant
<bool,
     !std::is_same<T0, T1>::value 
     && is_unique<T0, Rest...>::value 
     && is_unique<T1, Rest...>::value
>{};
 
#endif
}
 
#endif // TWOBLUECUBES_CATCH_TYPE_TRAITS_HPP_INCLUDED