On Monday, 12 August 2019 at 09:16:19 UTC, Alex wrote:
On Monday, 12 August 2019 at 08:54:56 UTC, lili wrote:
Hi:
Why need defined an abstract final class?
see
https://github.com/Rikarin/Trinix/blob/master/Kernel/arch/amd64/gdt.d
From what I saw, all members are static. So, this is a kind of
utility class, which is not supposed to be instantiated, nor to
be derived from. Maybe, it serves like a namespace, for
convenience...
its weird that next compiles in some weird form
import std;
static class A {
static a() { "a".writeln; } // forgot return type
}
void main() {
A.a();
A b, c; // 2 instances with diff addr
"%s %s".writefln( &b, &c );
}
// and for static struct DMD gives to A size 1b, LDC - 8b