Add support for plain-array as indices, e.g., mat({1,2,3,4})

This commit is contained in:
Gael Guennebaud
2017-01-06 21:53:32 +01:00
parent a875167d99
commit 3264d3c761
4 changed files with 23 additions and 2 deletions

View File

@@ -159,6 +159,12 @@ span(FirstType first, SizeType size) {
namespace internal {
template<typename T>
Index size(const T& x) { return x.size(); }
template<typename T,std::size_t N>
Index size(const T (&x) [N]) { return N; }
template<typename T, int XprSize, typename EnableIf = void> struct get_compile_time_size {
enum { value = Dynamic };
};