[Issue 6930] combined type of immutable(T) and inout(T) should be inout(const(T))

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 10 11:37:20 PST 2011


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


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |k.hara.pg at gmail.com


--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> 2011-11-10 11:36:41 PST ---
So let my try to understand what inout(const(T)) actually means.

If inout resolves to mutable or const, this becomes const(T)
If inout resolves to immutable, this becomes immutable(T)
If inout resolves to inout (i.e. nested inout function), then it stays as
inout(const(T))

Is this correct?

So what I think this boils down to is that inout(T) and immutable(T) should
implicitly cast to inout(const(T)), given the rules above.  It sure seems
plausible.

I think the same should be extended to inout(const(T))* and inout(const(T))[]

I'd like Kenji to weigh in (added to CC).  Does this affect the patch in bug
6912?

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