atomgalaxy / isocpp-universal-template-param

We propose a way to spell a universal template parameter kind. This would allow for a generic apply and other higher-order template metafunctions, and certain typetraits.
https://atomgalaxy.github.io/isocpp-universal-template-param/d1985r0.pdf
2 stars 2 forks source link

Eager checking example is confusing #29

Closed BengtGustafsson closed 1 year ago

BengtGustafsson commented 1 year ago

The description of eager checking clearly states that an UTP can only be uttered in template parameter list (where it is declared) and in template argument list (when forwarded to another UTP template parameter). This means that only by specializing a template with an UTP in the base case can we actually make use of this feature at all.

The example under Eager checking does not show this partial specialization scheme, but instead shows by trial and error some ways that an UTP can't be used. This should be evident from the fact that none of these ways are in a template argument list.

This strange example together with the reference to P0945 is probably what started the idea that eager is what is actually referred to as late and that late is the same as P0945. We know that P0945 doesn't work so that's off the table.

I think the example for eager should reflect what you can do with eager checking, not what you can't do.

We should also update the text to reflect that we recommend late checking.

(Note that I earlier erroneously claimed that Circle's implementation does early checking. It was just that I didn't know that it uses another way to express the disambiguation so regular disambiguation didn't work).