www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - On ref return in DMD

reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
The title

"More ref return fixes in std.datetime now that the compiler 
allows them"

of

https://github.com/D-Programming-Language/phobos/pull/2227/files

made me curious to what is meant by ref return. Is this a recent 
improvement in DMD?
Jun 03 2014
parent reply Jonathan M Davis via Digitalmars-d-learn writes:
On Tue, 03 Jun 2014 10:14:21 +0000
"Nordlöw" via Digitalmars-d-learn <digitalmars-d-learn puremagic.com>
wrote:

 The title

 "More ref return fixes in std.datetime now that the compiler
 allows them"

 of

 https://github.com/D-Programming-Language/phobos/pull/2227/files

 made me curious to what is meant by ref return. Is this a recent
 improvement in DMD?
No. We've been able to return by ref for ages. However, when std.datetime was originally written back in 2010, there were bugs that prevented it from working for a number of the functions in std.datetime. Unfortunately, I can't remember what the bugs were at this point, but they've long since been fixed, and I just finally got around to making it so that those functions in std.datetime return by ref instead of void. - Jonathan M Davis
Jun 03 2014
parent =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
 No. We've been able to return by ref for ages. However, when
Thx
Jun 03 2014