[Issue 5747] cannot cast away shared if opCast defined
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 26 00:28:31 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5747
Jonathan M Davis <jmdavisProg at gmx.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jmdavisProg at gmx.com
--- Comment #1 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-09-26 00:27:57 PDT ---
It's not just a question of shared. If you declare opCast on a struct, you can
cast to that _exact_ type (so S can be cast to S and const S can be cast to
const S), but you can't cast cast to any other version of that type (so, S
can't be cast to const S, and shared S can't be cast to S). As a workaround,
you can declare an opCast which returns those types, but it shouldn't be
necessary to declare an extra opCast to do what works when you haven't declared
opCast.
--
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