You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
L. A template may not use any procedures or operators except those
that have been specified in a REQUIRES statement.
Rationale: This is the notion of a "strong concept" which allows
template developers to ensure that a template does not
have any implicit requirements that might not be
detected for some unanticipated template parameters.
A colleague at LANL recently told me strong concepts sound cumbersome, in certain scenarios. For instance, if you have a deep tree of templated code, and you need to call a new function at the bottom, it's necessary to add a requirement for that interface at every level of the call stack. In some sense this is like passing data by argument, but this would be especially tedious when temporarily introducing extra operations for debugging purposes. Has subgroup discussed ways to mitigate this?
The text was updated successfully, but these errors were encountered:
Subgroup has discussed the issue, but ... guidance from our outside expert is that we should not poke holes in the system. One solution would be for compilers to simply provide a switch which deprecates violations of STRONG to merely a warning.
One related issue which has not quite been addressed is PRINT, WRITE, and READ. These are not procedures and thus are not currently disallowed in the specs, but ... they would be difficult to use in most templates. And I imagine that they will be appropriately constrained by the time we are done with the feature.
I see, yes this seems a fundamental cost to strong concepts (though not necessarily an overriding cost). A compiler switch would be a fair solution for debugging, assuming that's feasible for vendors to consider.
generics/J3-Papers/Generics_Requirements.txt
Lines 196 to 202 in 4e273a9
A colleague at LANL recently told me strong concepts sound cumbersome, in certain scenarios. For instance, if you have a deep tree of templated code, and you need to call a new function at the bottom, it's necessary to add a requirement for that interface at every level of the call stack. In some sense this is like passing data by argument, but this would be especially tedious when temporarily introducing extra operations for debugging purposes. Has subgroup discussed ways to mitigate this?
The text was updated successfully, but these errors were encountered: