Small suggestion for default constructors

H. S. Teoh hsteoh at qfbox.info
Tue Jan 17 15:40:08 UTC 2023


On Tue, Jan 17, 2023 at 03:12:09AM +0000, Adam D Ruppe via Digitalmars-d wrote:
[...]
> class Foo {
>         int x;
>         int y;
>         int z;
> 
>         // one little function
>         this(typeof(this.tupleof) t) {
>                 this.tupleof = t;
>         }
> }
[...]

Very nice!  Gotta use this in my own code sometime. :-D


T

-- 
Life is too short to run proprietary software. -- Bdale Garbee


More information about the Digitalmars-d mailing list