cast(public)

Robert Clipsham robert at octarineparrot.com
Sat Jul 18 02:19:21 PDT 2009


dsimcha wrote:
> struct Foo {
>     private uint bar;
> }
> 
> void main() {
>     Foo foo;
>     foo.bar++;  // error
>     (cast(public) foo.bar)++;  // Works.
> }

----
struct Foo {
    private uint bar;
}

void main() {
    Foo foo;
    foo.bar++;  // This works for me with dmd 1.026,
                // dmd 2.031 and ldc r1411
    // foo.bar is now 1.
}
----

Same effect for classes... Am I missing something or is this a bug?



More information about the Digitalmars-d mailing list