[Issue 3572] declaring pure function with void return type should be compile time error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 17 18:38:39 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3572
--- Comment #4 from David Simcha <dsimcha at yahoo.com> 2010-02-17 18:38:36 PST ---
(In reply to comment #3)
> Why doesn't it make sense? Aren't you thinking of inout parameters? A pure
> function void foo(out A a); ought to be exactly the same as A foo(); together
> with an assignment. I'm not seeing anything impure in that.
> BTW, it works fine in CTFE. (CTFE isn't quite the same concept as pure, but
> it's close).
You're right, I did get confused between out and ref. Allowing out parameters
in pure functions makes sense. I tend to forget how out parameters work
because I almost never use them. I almost always just return a tuple or a
struct.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list