Namespaces
Variants

Template talk:dcl header

From cppreference.com

cpp/headers is free of redlinks, can this template link to headers once again? --Cubbi 21:15, 5 August 2013 (PDT)

No objections here, but let's give P12 a chance to chime in. --Nate 07:26, 6 August 2013 (PDT)
That's a good idea. Thanks for filling in the missing pages. P12 16:06, 6 August 2013 (PDT)
Looks like a small bug was introduced with the last update. I guess in the second "Defined in header..." code block of this template, "1" should be "2". This shows up in cpp/algorithm/swap. --Fraser 17:53, 12 August 2013 (PDT)
Good catch. I've updated the template. --Nate 07:54, 13 August 2013 (PDT)

"Freestanding" annotation for freestanding headers

I would like to see, for every instantiation of this template, a little indicator of whether the header is required in freestanding implementations and, if so, in which versions of the standard.

(One who is developing for a freestanding implementation may look up standard library functions and then may want to quickly check whether a given function is required to be supported on freestanding.)

I propose that this info for every freestanding header H is written in the page cpp/header/H/freestanding; for non-freestanding headers, cpp/header/H/freestanding isn't created or is left empty. Then, Template:dcl header called for H can just use {{#if: {{#ifexist:cpp/header/{{{1}}}/freestanding|{{:cpp/header/{{{1}}}/freestanding}} }} }} to include the text of cpp/header/H/freestanding if it's present, include nothing otherwise.

For one header, only partial support is required in freestanding implementations; in this case I would like every specific page for supported functions to mention the freestanding support, and any pages for other names defined in the header not mention it. The mention should say in which versions of the standard the function is supported. It may be desirable to feed the mention into Template:dcl header as a separate parameter for further processing; in this case support for this parameter should be added.

Conclusion: I propose adding the mentioned wiki-code to the template so that, after filling all needed corresponding subpages, it is visible on any page for an entity whether the header defining this entity is supported on freestanding and in which standard versions (but only for fully supported headers), and I suggest adding a new parameter to the template in which the enclosing page separately specifies the freestanding support for its described entity (for supported entities in partially supported headers).

In total, 17 subpages for headers are to be filled, not counting the partially supported header, and 5 pages for functions in this header are to be modified to mention the support.

- 37.113.168.36 22:36, 10 September 2018 (PDT)

I think that it would be better to mark certain functions, macros and types with (freestanding). --Fruderica (talk) 01:59, 11 September 2018 (PDT)