Tatooine
common_type.h
Go to the documentation of this file.
1#ifndef TATOOINE_COMMON_TYPE_H
2#define TATOOINE_COMMON_TYPE_H
3//==============================================================================
4#include <type_traits>
5//==============================================================================
6namespace tatooine {
7//==============================================================================
8template <typename...>
10//------------------------------------------------------------------------------
11template <typename T>
13 using type = T;
14};
15//------------------------------------------------------------------------------
16template <typename T1, typename T2, typename... R>
17struct common_type_impl<T1, T2, R...> {
18 using type =
19 std::common_type_t<T1, typename common_type_impl<T2, R...>::type>;
20};
21//==============================================================================
22template <typename... Ts>
23using common_type = typename common_type_impl<Ts...>::type;
24//==============================================================================
25} // namespace tatooine
26//==============================================================================
27#endif
Definition: algorithm.h:6
typename common_type_impl< Ts... >::type common_type
Definition: common_type.h:23
std::common_type_t< T1, typename common_type_impl< T2, R... >::type > type
Definition: common_type.h:19
T type
Definition: common_type.h:13
Definition: common_type.h:9