[Issue 4867] Postblit is not usable with const objects

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 23 13:00:05 PDT 2011


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


Cristi Cobzarenco <cristi.cobzarenco at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cristi.cobzarenco at gmail.com


--- Comment #1 from Cristi Cobzarenco <cristi.cobzarenco at gmail.com> 2011-06-23 12:55:15 PDT ---
(In reply to comment #0)
> struct S
> {
>     this(this)
>     {
>     }
> }
> 
> void foo(ref const S s)
> {
>     auto s2 = s;
> }
> 
> void main()
> {  
> }
> 
> Error: function test.S.__cpctor (ref S p) is not callable using argument types
> (const(S)) const
> 
> It is not specified how postblit is supposed to interoperate with
> const/immutable. Tagging the postblit function with 'const' doesn't help
> (compilation fails with the same error).

The same problem happens when using 'in', as in:
void foo( in S s ) {

}

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