cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

JP6-026 20.3.2.5 p3 [util.smartptr.enab] Missing class template definition #568

Closed jensmaurer closed 9 months ago

jensmaurer commented 9 months ago

There should be a class template definition before the example.

Move class template definition before p1.

jensmaurer commented 9 months ago

This is increasingly common style: Present an example how to use a facility before defining the facility. We do that in [ranges] quite a bit.

@jwakely to chime in.

jwakely commented 9 months ago

I think this is talking about [util.smartptr.enab], right? (the stable name in the issue title isn't in C++23)

We've done this since at least C++11 (when this example was added) and I see no compelling reason to stop. The examples give a gentler introduction than a (possibly very long) class definition.

jensmaurer commented 9 months ago

There was no consensus for a change. Introducing a facility by showing an example use is considered reader-friendly.

tkoeppe commented 9 months ago

Noted.