[Issue 6221] Should be possible to pass struct function returns by 'const ref'.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 9 14:24:49 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6221


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #6 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-02-09 14:24:46 PST ---
I think that const auto ref does the trick, assuming that that works with
opCmp, but for some reason, it only works with templated functions at the
moment. I thought that it was supposed to work with non-templated functions as
well. If it doesn't, then I guess that the forced solution is to define an
overload which takes a const ref and one which takes the argument by value. It
would be much simpler if const ref could take a temporary, but Andrei is dead
set against that solution.


A related issue is the fact that

boo6221(S6221(5));

compiles while

boo6221(blah6221());

does not, since (for reasons that I've never understood) a struct literal is
considered an lvalue: issue# 5889.

-- 
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