Concepts trial - #5434
Conversation
|
I realise that most of these changes have also been suggested in #5372 - perhaps listing the concepts in AMReX_Concepts could make things more readable, however? |
|
Adding AMReX_Concepts is not a bad idea, but the unnecessary white space changes are unacceptable.
Don't use it. |
| * \brief Checks if a type is derived from amrex::BaseFab. | ||
| */ | ||
| template <typename T> | ||
| concept IsBaseFabType = amrex::IsBaseFab<T>::value; |
There was a problem hiding this comment.
As we know, naming is always the hardest thing. I don't think we should start with Is, because we might write code like below, which sounds awkward.
template <IsBaseFabType FAB> void f (FAB& fab);
Maybe we should use either BaseFabType or BaseFabLike.
Anyone who has an opinion, please feel free to chime in.
There was a problem hiding this comment.
There was a problem hiding this comment.
I agree with not having "Is" in the name. The standard library also doesn't have it.
template< class T >
concept floating_point = std::is_floating_point_v<T>;
Since BaseFAB is already taken, I think BaseFabType or FabType are fine.
There was a problem hiding this comment.
I've gone for BaseFabType/FabArrayType throughout
| * \brief Checks if a Interpolation is not generic MFInterpolater. | ||
| */ | ||
| template <typename Interp> | ||
| concept IsSpecificInterp = !std::is_same_v<Interp, amrex::MFInterpolater>; |
There was a problem hiding this comment.
I don't think this concept is useful, because its meaning is very unclear. I think we should remove this.
There was a problem hiding this comment.
Removed. It is something that does seem to appear throughout - should it be left as is, or just a clearer concept?
2e4fb93
into
AMReX-Codes:development
I've had a go at adding in a couple of trial
conceptsinto AMReX, specifically for theFillPatchUtilby adding inIsFabArrayType,IsBaseFabTypeandIsSpecificInterpconcepts. The large number of changes mostly comes from the formatter (does anyone have a suggestion for that?).A first step in #5375