Thread overview
[Issue 18618] templated functions should in general have their attributes inferred
Mar 15, 2018
Timothee Cour
Mar 17, 2018
Carsten Blüggel
Mar 17, 2018
Jonathan M Davis
Mar 17, 2018
Carsten Blüggel
Dec 17, 2022
Iain Buclaw
March 15, 2018
https://issues.dlang.org/show_bug.cgi?id=18618

Timothee Cour <timothee.cour2@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com,
                   |                            |timothee.cour2@gmail.com

--
March 17, 2018
https://issues.dlang.org/show_bug.cgi?id=18618

Carsten Blüggel <chilli@posteo.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chilli@posteo.net

--
March 17, 2018
https://issues.dlang.org/show_bug.cgi?id=18618

Jonathan M Davis <issues.dlang@jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang@jmdavisProg.co
                   |                            |m

--- Comment #1 from Jonathan M Davis <issues.dlang@jmdavisProg.com> ---
Templated functions should have their attributes inferred when whether attributes make sense depend on the template arguments (which the often do). However, if the attributes don't depend on the template arguments, then they really should be explicit. Whether any of the ones listed should have attributes inferred which currently are explicit, I don't know (I'd have to study them to know), and it's quite possible that all of the attributes listed here should be removed, but I don't think that it's a good policy to just not put attributes on templated functions. Whether they should be there or not depends on whether they depend on the template arguments.

--
March 17, 2018
https://issues.dlang.org/show_bug.cgi?id=18618

--- Comment #2 from Carsten Blüggel <chilli@posteo.net> ---
(In reply to Jonathan M Davis from comment #1)
> Templated functions should have their attributes inferred when whether attributes make sense depend on the template arguments (which the often do). However, if the attributes don't depend on the template arguments, then they really should be explicit. Whether any of the ones listed should have attributes inferred which currently are explicit, I don't know (I'd have to study them to know), and it's quite possible that all of the attributes listed here should be removed, but I don't think that it's a good policy to just not put attributes on templated functions. Whether they should be there or not depends on whether they depend on the template arguments.

Your guideline is new for me (but makes sense to me).
Please, add this to https://dlang.org/dstyle.html, which "misguided" me.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18618

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--