traits<Ref>::match: use correct strides

What does this implement/fix?

The construction of Ref<T, Options, Stride<0, 0>> from an instance with contiguous memory layout (plain object T, Map<T, Options>)

  • does not compile for mutable T, and
  • copies T into Ref::m_object, although this is unnecessary.

The reason for both is that internal::traits<Ref<PlainObjectType_, Options_, StrideType_>>::match simply uses StrideType_::InnerStrideAtCompileTime and StrideType_::OuterStrideAtCompileTime instead of the adapted values already computed in its base class.

With this fix, Ref<T, Options, Stride<0, 0>> can be created from an object with contiguous memory layout, and without copying it.

Merge request reports

Loading