Skip to content

Draft: Remove the FieldVector<K,1> specialization

Simon Praetorius requested to merge issue/fieldvector-1-constructors-2 into master

Summary

This MR removes the separate specialization of FieldVector<K,1> as a scalar type. Instead some functions are added to the primary template constrained to be only valid of SIZE == 1 case. Additionally, the interaction with scalar (field) types is being improved by allowing any type that is counted as IsNumber. Some alternatives were considered. Due to the implicit conversion operator of FieldVector<K,1> to const K&, several options lead to ambiguities.

Instead of using std::enable_if to constrain the functions to specific cases, this MR uses c++20 concepts and a requires clause. This makes the code more readable and the error messages better explaining what the problem is.

ToDo

  • Requires an updated compiler toolchain with c++20 enabled.
  • Extract some changes into separate MRs, e.g. !1492, !1493
  • Include changes from !1472 (merged) that makes DUNE_THROW usable in constexpr
Edited by Simon Praetorius

Merge request reports

Loading