Detect the bug in the following code

weaselcat via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 15 07:45:33 PDT 2015


On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote:
> import std.stdio;
>
> struct Foo {
>     bool registered = false;
>
>     void register(int x) {
>         writeln("Registering ", x);
>         register = true;
>     }
> }
>
> void main() {
>     Foo foo;
>     foo.register(10);
> }

register = true


More information about the Digitalmars-d mailing list