In the example below `func` changes its `const*` argument. Does this violates D's constness?

```d
import std;

struct S
{
    string s;

    void delegate(string s) update;
}

void func(const S* s)
{
    writeln(*s);
    s.update("func");
    writeln(*s);
}

void main()
{
    auto s = S("test");
    s.update = (_) { s.s = _; };

    writeln(s);
    func(&s);
    writeln(s);
}
```

The output is:
```
S("test", void delegate(string))
const(S)("test", void delegate(string))
const(S)("func", void delegate(string))
S("func", void delegate(string))
```

Reply via email to