Made sure the dummy element of size 0 array is always intialized to silence some compiler warnings

This commit is contained in:
Benoit Steiner 2016-02-03 15:58:26 -08:00
parent bcbde37a11
commit 1cbb79cdfd

View File

@ -165,10 +165,10 @@ template <typename T> class array<T, 0> {
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::size_t size() { return 0; }
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE array() { }
EIGEN_STRONG_INLINE array() : dummy(static_cast<T>(0)) { }
#ifdef EIGEN_HAS_VARIADIC_TEMPLATES
EIGEN_DEVICE_FUNC array(std::initializer_list<T> l) {
EIGEN_DEVICE_FUNC array(std::initializer_list<T> l) : dummy(static_cast<T>(0)) {
eigen_assert(l.size() == 0);
}
#endif