Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eigen 3.4 adds std::initializer_list constructors #51

Open
RMeli opened this issue Sep 18, 2021 · 0 comments
Open

Eigen 3.4 adds std::initializer_list constructors #51

RMeli opened this issue Sep 18, 2021 · 0 comments
Assignees
Labels

Comments

@RMeli
Copy link
Owner

RMeli commented Sep 18, 2021

Eigen 3.4 adds std::initializer_list constructors and this does not play nicely with the custom constructor defined in libirc/plugins/eigen/.

Trying to compile with Eigen 3.4 results in the following error, given that there are now two constructors with the same signature:

/Users/rmeli/Documents/git/projects/irc/src/test/wilson_test.cpp:92:9: error: call to constructor of 'const Eigen::Matrix<double, -1, -1, 0>' is ambiguous
        {// Rotation for H1
        ^~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Matrix.h:321:34: note: candidate constructor
    explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
                                 ^
/Users/rmeli/Documents/git/projects/irc/include/libirc/plugins/eigen/Matrix_initializer_list.h:60:21: note: candidate constructor
EIGEN_STRONG_INLINE Matrix(std::initializer_list<std::initializer_list<_Scalar>> initlist) : Base()
                    ^
/Users/rmeli/Documents/git/projects/irc/src/test/wilson_test.cpp:96:9: error: call to constructor of 'const Eigen::Matrix<double, -1, -1, 0>' is ambiguous
        {// Rotation for O
        ^~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Matrix.h:321:34: note: candidate constructor
    explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
                                 ^
/Users/rmeli/Documents/git/projects/irc/include/libirc/plugins/eigen/Matrix_initializer_list.h:60:21: note: candidate constructor
EIGEN_STRONG_INLINE Matrix(std::initializer_list<std::initializer_list<_Scalar>> initlist) : Base()
                    ^
/Users/rmeli/Documents/git/projects/irc/src/test/wilson_test.cpp:100:9: error: call to constructor of 'const Eigen::Matrix<double, -1, -1, 0>' is ambiguous
        {// Rotation for H2
        ^~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Matrix.h:321:34: note: candidate constructor
    explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
                                 ^
/Users/rmeli/Documents/git/projects/irc/include/libirc/plugins/eigen/Matrix_initializer_list.h:60:21: note: candidate constructor
EIGEN_STRONG_INLINE Matrix(std::initializer_list<std::initializer_list<_Scalar>> initlist) : Base()
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/vector:566:41: note: passing argument to parameter '__il' here
    vector(initializer_list<value_type> __il);
                                        ^
/Users/rmeli/Documents/git/projects/irc/src/test/wilson_test.cpp:170:15: error: call to constructor of 'const mat' (aka 'const Matrix<double, Dynamic, Dynamic>') is ambiguous
    const mat R{{cos(angle_rad), -sin(angle_rad), 0},
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Matrix.h:321:34: note: candidate constructor
    explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
                                 ^
/Users/rmeli/Documents/git/projects/irc/include/libirc/plugins/eigen/Matrix_initializer_list.h:60:21: note: candidate constructor
EIGEN_STRONG_INLINE Matrix(std::initializer_list<std::initializer_list<_Scalar>> initlist) : Base()
                    ^
4 errors generated.
@RMeli RMeli added the problem label Sep 18, 2021
@RMeli RMeli self-assigned this Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant