Re: final struct ?

2020-05-20 Thread wjoe via Digitalmars-d-learn
On Wednesday, 20 May 2020 at 04:40:33 UTC, user1234 wrote: On Tuesday, 19 May 2020 at 10:29:51 UTC, wjoe wrote: On Tuesday, 19 May 2020 at 10:08:37 UTC, user1234 wrote: [...] Thank you. A little sample to show you more cases of attributes that have no effect: --- struct Foo { nothrow

Re: final struct ?

2020-05-19 Thread user1234 via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 10:29:51 UTC, wjoe wrote: On Tuesday, 19 May 2020 at 10:08:37 UTC, user1234 wrote: On Tuesday, 19 May 2020 at 10:01:34 UTC, wjoe wrote: [...] It has no purpose. In D many attributes are allowed even if they have no meaning. D-Scanner checks this kind of stuff, to s

Re: final struct ?

2020-05-19 Thread wjoe via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 10:08:37 UTC, user1234 wrote: On Tuesday, 19 May 2020 at 10:01:34 UTC, wjoe wrote: [...] It has no purpose. In D many attributes are allowed even if they have no meaning. D-Scanner checks this kind of stuff, to some extent, but not the compiler. Thank you.

Re: final struct ?

2020-05-19 Thread user1234 via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 10:01:34 UTC, wjoe wrote: As I was reading a few source files of a library I found dozens of final struct declarations like this: final struct Foo { const pure final nothrow bar() { ... } } What's this supposed to express ? A final class is a class that

final struct ?

2020-05-19 Thread wjoe via Digitalmars-d-learn
As I was reading a few source files of a library I found dozens of final struct declarations like this: final struct Foo { const pure final nothrow bar() { ... } } What's this supposed to express ? A final class is a class that can't be subclassed - structs can't be subc