E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches
eve::common_compatible< Ts > Struct Template Reference

Computes the type compatible with a list of values. More...

#include <eve/traits/common_compatible.hpp>

Detailed Description

template<typename... Ts>
struct eve::common_compatible< Ts >

Required header: #include <eve/traits/common_compatible.hpp>

If all Ts... are all identical to a given T and model eve::value, provides the member typedef type which is defined as T.

If Ts... contains a set of types modeling eve::scalar_value and a set of types modeling eve::simd_value all identical to a given T, provides the member typedef type which is defined as T.

Otherwise, the program is ill-formed.

Template Parameters
TsVariadic list of types to process

Member types

Name Definition
type The type defined as compatible with all Ts...


Helper types

template<typename Ts...>
using common_compatible_t = typename common_compatible<Ts...>::type;
Computes the type compatible with a list of values.
Definition common_compatible.hpp:105


Example

See it live on Compiler Explorer

1#include <iostream>
2#include <eve/traits/common_compatible.hpp>
3#include <eve/wide.hpp>
4
5int main()
6{
9 using mixed_type = eve::common_compatible<int, eve::wide<float>, double>::type;
10
11 std::cout << std::boolalpha
12 << std::is_same<float_type, float>::value << "\n"
13 << std::is_same<wide_float_type, eve::wide<float>>::value << "\n"
14 << std::is_same<mixed_type, eve::wide<float>>::value << "\n";
15}
Wrapper for SIMD registers.
Definition wide.hpp:70