Skip to content

pass enumeration argument to constructor of VectorXd

Submitted by Huang Qinjin

Assigned to Nobody

Link to original bugzilla bug (#1692)
Version: 3.3 (current stable)

Description

Currently, the constructor of VectorXd requires Integer by the assertion of NumTraits<T>::IsInteger to specify the length. Will it be fine to releax to any type that convertible to int, such as a enumeration. The following code gets compilation
error: static assertion failed: FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED.

enum : int {  
    Size = 2,  
};   

VectorXd V(Size);  

Blocking

#814 (closed)

Edited by Eigen Bugzilla