@@ -32,15 +32,6 @@ template <typename> struct use_fast_math : std::false_type {};
32
32
#endif
33
33
template <typename T> constexpr bool use_fast_math_v = use_fast_math<T>::value;
34
34
35
- // Common utility for selecting a type based on the specified size.
36
- template <size_t Size, typename T8, typename T16, typename T32, typename T64>
37
- using select_scalar_by_size_t = std::conditional_t <
38
- Size == 1 , T8,
39
- std::conditional_t <
40
- Size == 2 , T16,
41
- std::conditional_t <Size == 4 , T32,
42
- std::conditional_t <Size == 8 , T64, void >>>>;
43
-
44
35
template <size_t N, size_t ... Ns> constexpr bool CheckSizeIn () {
45
36
constexpr bool SameSize[] = {(N == Ns)...};
46
37
// Replace with std::any_of with C++20.
@@ -50,32 +41,6 @@ template <size_t N, size_t... Ns> constexpr bool CheckSizeIn() {
50
41
return false ;
51
42
}
52
43
53
- // Checks if the type of the operation is the same. For scalars and marray that
54
- // requires the types to be exact matches. For vector and swizzles it requires
55
- // that the corresponding vector conversion is the same.
56
- template <typename T1, typename T2, typename = void >
57
- struct is_same_op : std::is_same<T1, T2> {};
58
-
59
- template <typename T1, typename T2>
60
- constexpr bool is_same_op_v = is_same_op<T1, T2>::value;
61
-
62
- // Constexpr function for checking that all types are the same, considering
63
- // swizzles and vectors the same if they have the same number of elements and
64
- // the same element type.
65
- template <typename T, typename ... Ts> constexpr bool CheckAllSameOpType () {
66
- constexpr bool SameType[] = {
67
- is_same_op_v<std::remove_cv_t <T>, std::remove_cv_t <Ts>>...};
68
- // Replace with std::all_of with C++20.
69
- for (size_t I = 0 ; I < sizeof ...(Ts); ++I)
70
- if (!SameType[I])
71
- return false ;
72
- return true ;
73
- }
74
-
75
- // NOTE: We need a constexpr variable definition for the constexpr functions
76
- // as MSVC thinks function definitions are the same otherwise.
77
- template <typename ... Ts>
78
- constexpr bool check_all_same_op_type_v = CheckAllSameOpType<Ts...>();
79
44
// NOTE: We need a constexpr variable definition for the constexpr functions
80
45
// as MSVC thinks function definitions are the same otherwise.
81
46
template <size_t ... Ns> constexpr bool check_size_in_v = CheckSizeIn<Ns...>();
0 commit comments