digitalmars.D.learn - Object.dup?
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/3) Aug 30 2021 Why doesn't `Object` have an auto-defined `.dup` property? It
- Adam D Ruppe (6/7) Aug 30 2021 I don't think it could. What if you have a child class with a
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/6) Aug 31 2021 Yes, thanks. I was interested in the possibility of a single
Why doesn't `Object` have an auto-defined `.dup` property? It would be useful when dealing with, for instance, handling of `Throwable`'s in multi-threaded contexts.
Aug 30 2021
On Monday, 30 August 2021 at 20:21:38 UTC, Per Nordlöw wrote:Why doesn't `Object` have an auto-defined `.dup` property?I don't think it could. What if you have a child class with a delegate that points to one of its own methods? You can define one yourself of course with overrides in child classes to update those kinds of things. But doing it automatically is tricky.
Aug 30 2021
On Monday, 30 August 2021 at 20:32:28 UTC, Adam D Ruppe wrote:You can define one yourself of course with overrides in child classes to update those kinds of things. But doing it automatically is tricky.Yes, thanks. I was interested in the possibility of a single non-member function, though.
Aug 31 2021