Replace Eigen type metaprogramming with corresponding std types and make use of alias templates

This commit is contained in:
Erik Schultheis
2022-03-16 16:43:40 +00:00
committed by Antonio Sánchez
parent 514f90c9ff
commit 421cbf0866
191 changed files with 1147 additions and 1221 deletions

View File

@@ -2573,7 +2573,7 @@ template<int N, typename EnableIf = void>
struct plogical_shift_left_impl;
template<int N>
struct plogical_shift_left_impl<N, typename enable_if<(N < 32) && (N >= 0)>::type> {
struct plogical_shift_left_impl<N, std::enable_if_t<(N < 32) && (N >= 0)>> {
static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
static const unsigned n = static_cast<unsigned>(N);
const Packet4ui shift = {n, n, n, n};
@@ -2587,7 +2587,7 @@ struct plogical_shift_left_impl<N, typename enable_if<(N < 32) && (N >= 0)>::typ
};
template<int N>
struct plogical_shift_left_impl<N, typename enable_if<(N >= 32)>::type> {
struct plogical_shift_left_impl<N, std::enable_if_t<(N >= 32)>> {
static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
static const unsigned m = static_cast<unsigned>(N - 32);
const Packet4ui shift = {m, m, m, m};
@@ -2605,7 +2605,7 @@ template<int N, typename EnableIf = void>
struct plogical_shift_right_impl;
template<int N>
struct plogical_shift_right_impl<N, typename enable_if<(N < 32) && (N >= 0)>::type> {
struct plogical_shift_right_impl<N, std::enable_if_t<(N < 32) && (N >= 0)>> {
static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
static const unsigned n = static_cast<unsigned>(N);
const Packet4ui shift = {n, n, n, n};
@@ -2619,7 +2619,7 @@ struct plogical_shift_right_impl<N, typename enable_if<(N < 32) && (N >= 0)>::ty
};
template<int N>
struct plogical_shift_right_impl<N, typename enable_if<(N >= 32)>::type> {
struct plogical_shift_right_impl<N, std::enable_if_t<(N >= 32)>> {
static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
static const unsigned m = static_cast<unsigned>(N - 32);
const Packet4ui shift = {m, m, m, m};

View File

@@ -31,22 +31,22 @@ class TupleImpl<N, T1, Ts...> {
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
// Default constructor, enable if all types are default-constructible.
template<typename U1 = T1, typename EnableIf = typename std::enable_if<
template<typename U1 = T1, typename EnableIf = std::enable_if_t<
std::is_default_constructible<U1>::value
&& reduce_all<std::is_default_constructible<Ts>::value...>::value
>::type>
>>
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC
TupleImpl() : head_{}, tail_{} {}
// Element constructor.
template<typename U1, typename... Us,
// Only enable if...
typename EnableIf = typename std::enable_if<
typename EnableIf = std::enable_if_t<
// the number of input arguments match, and ...
sizeof...(Us) == sizeof...(Ts) && (
// this does not look like a copy/move constructor.
N > 1 || std::is_convertible<U1, T1>::value)
>::type>
>>
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC
TupleImpl(U1&& arg1, Us&&... args)
: head_(std::forward<U1>(arg1)), tail_(std::forward<Us>(args)...) {}
@@ -253,9 +253,9 @@ get(TupleImpl<sizeof...(Types), Types...>& tuple) {
* \return concatenated tuple.
*/
template<typename... Tuples,
typename EnableIf = typename std::enable_if<
typename EnableIf = std::enable_if_t<
internal::reduce_all<
is_tuple<typename std::decay<Tuples>::type>::value...>::value>::type>
is_tuple<typename std::decay<Tuples>::type>::value...>::value>>
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
typename tuple_cat_impl<sizeof...(Tuples), typename std::decay<Tuples>::type...>::ReturnType
tuple_cat(Tuples&&... tuples) {