tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
common_reference.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_TYPE_TRAITS_COMMON_REFERENCE_HPP
4
#define TETL_TYPE_TRAITS_COMMON_REFERENCE_HPP
5
6
#include <
etl/_type_traits/basic_common_reference.hpp
>
7
#include <
etl/_type_traits/integral_constant.hpp
>
8
#include <
etl/_type_traits/is_same.hpp
>
9
10
namespace
etl
{
11
17
template
<
typename
... T>
18
struct
common_reference
;
19
20
// if sizeof...(T) is zero
21
template
<>
22
struct
common_reference
<> { };
23
24
// if sizeof...(T) is one
25
template
<
typename
T>
26
struct
common_reference
<T> {
27
using
type
= T;
28
};
29
31
template
<
typename
T,
typename
U>
32
requires
is_same_v<T, U>
33
struct
common_reference
<T, U> {
34
using
type
= T;
35
};
36
37
template
<
typename
... T>
38
using
common_reference_t
=
typename
common_reference
<T...>::type;
39
40
}
// namespace etl
41
42
#endif
// TETL_TYPE_TRAITS_COMMON_REFERENCE_HPP
basic_common_reference.hpp
integral_constant.hpp
is_same.hpp
etl
Definition
adjacent_find.hpp:8
etl::is_same_v
constexpr bool is_same_v
Definition
is_same.hpp:11
etl::common_reference_t
typename common_reference< T... >::type common_reference_t
Definition
common_reference.hpp:38
etl::common_reference< T, U >::type
T type
Definition
common_reference.hpp:34
etl::common_reference< T >::type
T type
Definition
common_reference.hpp:27
etl::common_reference
Determines the common reference type of the types T..., that is, the type to which all the types in T...
Definition
common_reference.hpp:18
include
etl
_type_traits
common_reference.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0