Comment #0 by bearophile_hugs — 2012-05-24T14:57:18Z
This compiles with no errors nor warnings (dmd 2.060alpha):
struct Foo(T) {}
Foo!void f;
void main() {}
While a C++ compiler as G++ 4.7 gives:
error: ‘void’ is not a valid type for a template constant parameter
On IRC someone has said this is a feature of D. If this feature is present in D docs then I suggest to make such note a bit more evident and to explain a bit how this feature is useful. I think this is useful for C++ programmers.
Comment #1 by bugzilla — 2012-05-24T16:41:02Z
I would think a note would be necessary to explain why void would be disallowed. But I can't think of a reason for that. C++ disallowing it is not a sufficient reason.
Comment #2 by bugzilla — 2012-05-24T16:42:25Z
I am going to mark this as invalid. If a sufficient rationale is presented, it can be reopened.