Feature Request: make void a value type

downs default_357-line at yahoo.de
Mon Dec 3 08:54:21 PST 2007


Proposal: to allow us to treat void as a value type.
What this would allow:
 * simplifying templates that differ between return type, i.e. static if (is(ReturnType!(C)==void)) param(); else return param();
    I write code like that all the time :(
 * Allowing sets, i.e. void[int] .. this is something many newcomers intuitively expect to work; and by rights, it should.

Problems:
 * With void.sizeof being 0, void is the only type where an array has completely different properties than the original type. I'm not sure whether this really is a problem.

Code this breaks:
 * None that I can see; it only seems to affect situations that would be illegal under the current spec.

What do you think?
 --downs



More information about the Digitalmars-d mailing list