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