Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 14, 2015 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #1 from Sobirari Muhomori <dfj1esp02@sneakemail.com> --- IIRC, typeof(fun) gives the function's return type. -- |
December 14, 2015 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #2 from Luís Marques <luis@luismarques.eu> --- But if it is a function *template* then the type will be void. That's what could be better documented, IMHO. -- |
December 14, 2015 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #3 from Sobirari Muhomori <dfj1esp02@sneakemail.com> --- Maybe it's not an intended behavior and type of template should be `template`? -- |
December 14, 2015 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 ZombineDev <petar.p.kirov@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |petar.p.kirov@gmail.com --- Comment #4 from ZombineDev <petar.p.kirov@gmail.com> --- Maybe something like this: T add(T)(T a, T b) { return a + b; } static assert (is(typeof(add) == template)); alias add2 = (a,b) => a + b; static assert (is(typeof(add2) == template)); ? -- |
December 14, 2015 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #5 from ZombineDev <petar.p.kirov@gmail.com> --- Though this would add overlap to the functionality already provided by http://dlang.org/spec/traits.html#isTemplate. Also related: https://github.com/D-Programming-Language/dmd/pull/5201 -- |
December 24, 2016 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 Andrei Alexandrescu <andrei@erdani.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |trivial CC| |andrei@erdani.com -- |
May 05, 2018 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 Johannes Loher <johannes.loher@fg4f.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |johannes.loher@fg4f.de --- Comment #6 from Johannes Loher <johannes.loher@fg4f.de> --- Related: https://issues.dlang.org/show_bug.cgi?id=7947 I briefly talked to both Andrei and Walter today at dconf about this. They both agreed, that calling typeof on a template should be an error (similiar to how calling typeof on a type is an error). Any thoughts on that? -- |
May 05, 2018 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 Andrei Alexandrescu <andrei@erdani.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |preapproved --- Comment #7 from Andrei Alexandrescu <andrei@erdani.com> --- preapproved -- |
May 05, 2018 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #8 from Johannes Loher <johannes.loher@fg4f.de> --- Realated comment in the corresponding section in dmd: /* Today, 'typeof(func)' returns void if func is a * function template (TemplateExp), or * template lambda (FuncExp). * It's actually used in Phobos as an idiom, to branch code for * template functions. */ Does anybody know where this is actually used in phobos? Wouldn't it be better to use isTemplate in this case? -- |
January 03, 2020 [Issue 15437] documentation for typeof(someTemplate) == void | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=15437 berni44 <bugzilla@d-ecke.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@d-ecke.de Severity|enhancement |normal -- |
Copyright © 1999-2021 by the D Language Foundation