Skip to content
Snippets Groups Projects

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

Pipeline #23071 passed

Pipeline passed for bed4e242 on fix/fix-inconsistent-1d-dense-vector-conversions

Approval is optional

Merged by Christoph GrüningerChristoph Grüninger 5 years ago (Dec 19, 2019 9:49pm UTC)

Merge details

  • Changes merged into master with 5304152a.
  • Deleted the source branch.

Pipeline #23073 passed

Pipeline passed for 5304152a on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading