Skip to content

Fix inconsistent chained DenseVector ctors/assignment.

The commit also adds a test which fails without the other changes in the commit.

Problem is that DenseVector and FieldVector<..., 1> implement catch-all assignment constructors and ctors. I.e., the 1d FieldVector provides CTOR call-signatures and the DenseVector provides and assignment operator

std::is_assignable<To, From> std::is_convertible<From, To>

This poses a problem when nesting vectors and trying to assign to them from another DenseVector implementation.

The problem is that the implementation of the CTOR and the assignment operation fails, but OTOH the FieldVector implementation uses std::is_convertible. Now std::convertible will report "yes" but the body of the assignment operation will fail nevertheless.

The commit fixes this by restricting the call-signature to the cases where the implementation of the assignment and the CTOR will succeed but testing the assignability of DV::value_type.

Supersedes !562 (closed) as this is a rebased and squased version.

Merge request reports