Home Internal compiler error on a template function specialization
Reply: 0

Internal compiler error on a template function specialization

user1657
1#
user1657 Published in June 24, 2018, 3:26 am

I have a code that worked on Lunix/GCC. However, when compiling on Windows/MSVC 2017, I am facing an internal compiler error:

.hpp:

namespace g2o {
namespace internal {

    template<typename MatrixType>
    inline void axpy(const MatrixType& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
        y.segment<MatrixType::RowsAtCompileTime>(yoff) += A * x.segment<MatrixType::ColsAtCompileTime>(xoff);
    }

    template<int t>
    inline void axpy(const Eigen::Matrix<double, Eigen::Dynamic, t>& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
        y.segment(yoff, A.rows()) += A * x.segment<Eigen::Matrix<double, Eigen::Dynamic, t>::ColsAtCompileTime>(xoff);
    }

    template<> /*******ERROR HERE*******/
    inline void axpy(const Eigen::MatrixXd& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
        y.segment(yoff, A.rows()) += A * x.segment(xoff, A.cols());
    }   
} // end namespace internal
} // end namespace g2o

I saw solution telling that I should do the following:

template<Eigen::MatrixXd> inline void axpy<Eigen::MatrixXd> ....

However, it did not work.


Error message as it was produced by the compiler:

Error C1001 An internal error has occurred in the compiler.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.535747 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO