This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 1461

Summary: Map<const Quaterniond> compile error
Product: Eigen Reporter: Huang Qinjin <huangqinjin>
Component: GeometryAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: Unknown CC: chtz, gael.guennebaud, hauke.heibel, jacob.benoit.1
Priority: Normal    
Version: 3.3 (current stable)   
Hardware: x86 - 64-bit   
OS: Linux   
Whiteboard:

Description Huang Qinjin 2017-08-11 04:55:17 UTC
With g++ 5.4 and eigen 3.3.4 on ubuntu 16.04

    const double d[4] = {0, 0, 0, 1};

    Map<const Vector4d> v(d);
    double s = v.w();             // ok

    Map<const Quaterniond> q(d);
    double w = q.w();             // compile error

/usr/local/include/eigen3/Eigen/src/Geometry/Quaternion.h:76:84: error: binding ‘const Scalar {aka const double}’ to reference of type ‘Eigen::QuaternionBase<Eigen::Map<const Eigen::Quaternion<double> > >::Scalar& {aka double&}’ discards qualifiers
   EIGEN_DEVICE_FUNC inline Scalar& w() { return this->derived().coeffs().coeffRef(3); }
Comment 2 Nobody 2019-12-04 17:09:44 UTC
-- 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/1461.