[Issue 15087] DDoc: Add function attributes section for templates

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 18 21:50:27 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=15087

Jakob Ovrum <jakobovrum at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakobovrum at gmail.com

--- Comment #1 from Jakob Ovrum <jakobovrum at gmail.com> ---
(In reply to Jack Stouffer from comment #0)
> Currently, as function templates are auto attributed, there is no way to
> know if a template is nothrow, pure, @nogc, or @safe without trying to run
> it in your code and seeing if it will compile. That sucks and is tedious.
> 
> So what this bug report is proposing is to add a new section in ddoc headers
> that allows maintainers of phobos to very visually show what attributes the
> template will have with what arguments.
> 
> Sure, sometimes the documentation will say that if the template is @nogc or
> not, but not all the time.
> 
> Also, this answers a common question new comers have, which is "doesn't the
> std lib use the GC?" To which the response is "Not all of it". To which the
> follow up is "Ok, what parts use it and what parts don't?", followed by
> crickets.

DDoc section can be added arbitrarily with any name, there are no restrictions
on them, except a few of them get special handling like `Params`.

Does the proposed section need any special handling? If not, this isn't a DMD
issue.

--


More information about the Digitalmars-d-bugs mailing list