[Issue 15437] New: documentation for typeof(someTemplate) == void
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Dec 12 15:58:16 PST 2015
https://issues.dlang.org/show_bug.cgi?id=15437
Issue ID: 15437
Summary: documentation for typeof(someTemplate) == void
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dlang.org
Assignee: nobody at puremagic.com
Reporter: luis at luismarques.eu
Consider this:
auto tee(alias fun, Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1)(R1
inputRange) if (is(typeof(fun) == void) || isSomeFunction!fun);
It is not immediately obvious in what situation `fun` would have (typeof(fun)
== void) unless you know that templates received through an alias have typeof
void, but there doesn't seem to be any place in the documentation mentioning
that fact.
Even if this is mentioned in the docs somewhere, it might still be worth
redundantly mentioning this in more than one place. Consider the sections on
AliasDeclaration and typeof (part of the declaration docs), and the Template
docs.
--
More information about the Digitalmars-d-bugs
mailing list