Why do struct literals count as lvalues?
Trass3r
un at known.com
Thu Aug 18 13:33:47 PDT 2011
Am 18.08.2011, 22:19 Uhr, schrieb Jonathan M Davis <jmdavisProg at gmx.com>:
> Yeah. I don't understand why a struct literal would be an lvalue. It's a
> temporary. What possible value does it have? It's not a variable. It
> doesn't
> refer to a variable. Why would you be able to assign to anything which
> is not
> a variable (or indirectly refers to one - e.g. with ref)?
I don't understand it either.
It only makes sense with const ref.
More information about the Digitalmars-d
mailing list