mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-29 23:34:12 +08:00
Change array_size result from enum to constexpr.
This commit is contained in:
parent
8a73c6490f
commit
feaafda30a
@ -204,19 +204,19 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T& array_get(const array<T, N>& a) {
|
|||||||
|
|
||||||
template <class T, std::size_t N>
|
template <class T, std::size_t N>
|
||||||
struct array_size<array<T, N> > {
|
struct array_size<array<T, N> > {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
template <class T, std::size_t N>
|
template <class T, std::size_t N>
|
||||||
struct array_size<array<T, N>&> {
|
struct array_size<array<T, N>&> {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
template <class T, std::size_t N>
|
template <class T, std::size_t N>
|
||||||
struct array_size<const array<T, N> > {
|
struct array_size<const array<T, N> > {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
template <class T, std::size_t N>
|
template <class T, std::size_t N>
|
||||||
struct array_size<const array<T, N>&> {
|
struct array_size<const array<T, N>&> {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
|
@ -303,30 +303,30 @@ class noncopyable {
|
|||||||
*/
|
*/
|
||||||
template <typename T, typename EnableIf = void>
|
template <typename T, typename EnableIf = void>
|
||||||
struct array_size {
|
struct array_size {
|
||||||
enum { value = Dynamic };
|
static constexpr Index value = Dynamic;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct array_size<T, std::enable_if_t<((T::SizeAtCompileTime & 0) == 0)>> {
|
struct array_size<T, std::enable_if_t<((T::SizeAtCompileTime & 0) == 0)>> {
|
||||||
enum { value = T::SizeAtCompileTime };
|
static constexpr Index value = T::SizeAtCompileTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, int N>
|
template <typename T, int N>
|
||||||
struct array_size<const T (&)[N]> {
|
struct array_size<const T (&)[N]> {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
template <typename T, int N>
|
template <typename T, int N>
|
||||||
struct array_size<T (&)[N]> {
|
struct array_size<T (&)[N]> {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, std::size_t N>
|
template <typename T, std::size_t N>
|
||||||
struct array_size<const std::array<T, N>> {
|
struct array_size<const std::array<T, N>> {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
template <typename T, std::size_t N>
|
template <typename T, std::size_t N>
|
||||||
struct array_size<std::array<T, N>> {
|
struct array_size<std::array<T, N>> {
|
||||||
enum { value = N };
|
static constexpr Index value = N;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \internal
|
/** \internal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user