Pointer to element of Ref<const Array<...>>

  • Operating system: Windows 10
  • Architecture: x64
  • Eigen version: 3.3.9 and 3.4-RC1
  • Compiler: Visual Studio 2019

The following code should compile (I think) but fails to do so with "error C2102: '&' requires l-value"

void f()
{
    Eigen::ArrayXf A(10);
    Eigen::Ref<const Eigen::ArrayXf> B(A);
    const float* p = &B(0);                       // This line does not compile
    (void)p;
}
Edited by Johan Råde