#include <Eigen/Dense> template<class T>void f(T const& t){ } int main() { f(Eigen::Vector3d::SizeAtCompileTime); } This fails to compile with Intel's compiler and produces a warning with clang. Note that the following causes the same error: enum { a=0 }; f(a); but not this: enum dummy { b=0 }; f(b); I hit this when calling std::min with this argument (no, not with Vector3d, with a template matrix type).
hm ok. but maybe for such use cases it is probably better to cast the enum to int anyway: f(int(Eigen::Vector3d::SizeAtCompileTime));
(In reply to comment #1) > hm ok. but maybe for such use cases it is probably better to cast the enum to > int anyway: > f(int(Eigen::Vector3d::SizeAtCompileTime)); Well, it is better to cast with the current implementation, but as a user it is fairly confusing that you have to do it at all. I am not asking you to change it, just making sure you are aware that this syntax means we have to write: std::min(static_cast<int>(Vec1::SizeAtCompileTime),static_cast<int>(Vec2::SizeAtCompileTime)).
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/263.