Skip to content

Commit c9a1c1f

Browse files
pbackusdlang-bot
authored andcommitted
Fix issue 15437 - documentation for typeof(someTemplate) == void
1 parent e5b7e14 commit c9a1c1f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/type.dd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,15 @@ $(GNAME Typeof):
513513
typeof(S.foo) n; // n is declared to be an int
514514
--------------------
515515

516+
$(P If the expression is a $(DDLINK, spec/template, Template, Template),
517+
$(D typeof) gives the type $(D void).
518+
)
519+
520+
--------------------
521+
template t {}
522+
static assert(is(typeof(t) == void));
523+
--------------------
524+
516525
$(BEST_PRACTICE
517526
$(OL
518527
$(LI $(I Typeof) is most useful in writing generic

0 commit comments

Comments
 (0)