[J3] [EXTERNAL] Re: Slides available for your preview - Part 2 of the Generics Tutorial today at the J3 plenary
Ondřej Čertík
ondrej at certik.us
Mon Mar 8 23:33:06 UTC 2021
Hi Bill,
What you are proposing is called "weak restrictions". See the slides for pros and cons of your approach.
The main big advantage of "strong restrictons" over "weak restrictions" is that as a library developer the compiler will give an error message if you used a template operation that you didn't intend to (didn't specify in the template requirements).
Under your proposal (i.e., "weak requirements") the compiler will "figure out the requirements" (if it can, as there might be cases where that might be difficult, as Tom and Gary mentioned), which means that it will not give any error for the library developer. The error will come for the end users who try to use their own templates. We argue this is not what we want.
I strongly encourage you to read through the document that we prepared:
https://github.com/j3-fortran/generics/blob/2d3f08078bb1c567e8b4f4e830f26a868cca8258/theory/comparison/comparison.md
and play especially with the C++ example which uses "weak restrictions".
Also, why don't you join us for our next generics meeting? We can discuss this in much deeper detail.
Ondrej
More information about the J3
mailing list