On Tuesday, August 13, 2019 3:03:49 AM MDT Jacob Carlborg via Digitalmars-d-
learn wrote:
> On 2019-08-12 11:25, a11e99z wrote:
> > its weird that next compiles in some weird form
> >
> > import std;
> > static class A {
> >
> > static a() { "a".writeln; } // forgot return type
> >
> > }
>
> S
On 2019-08-12 11:25, a11e99z wrote:
its weird that next compiles in some weird form
import std;
static class A {
static a() { "a".writeln; } // forgot return type
}
Since you have specified an attribute on "a", the compiler can infer the
return type. In this case it's inferred to "void"
On Monday, August 12, 2019 2:54:56 AM MDT lili via Digitalmars-d-learn
wrote:
> Hi:
> Why need defined an abstract final class?
> see
> https://github.com/Rikarin/Trinix/blob/master/Kernel/arch/amd64/gdt.d
It's one way to effectively create a namespace using a class.
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
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
Hi:
Why need defined an abstract final class?
see
https://github.com/Rikarin/Trinix/blob/master/Kernel/arch/amd64/gdt.d
On Friday, 25 September 2015 at 10:28:56 UTC, ref2401 wrote:
If I declare a class as `final` do I have to mark all methods
of the class as `final` too?
A final class can't be subclassed, so none of its methods can be
overridden anyway.
Am Fri, 25 Sep 2015 10:28:54 +
schrieb ref2401 :
> If I declare a class as `final` do I have to mark all methods of
> the class as `final` too?
No.
--
Marco
If I declare a class as `final` do I have to mark all methods of
the class as `final` too?
On Mon, 03 Mar 2014 21:48:16 -0500, Casper Færgemand
wrote:
Is there any loss in performance instantiating an interface variable as
a final class implementing only that interface, as opposed to a class
variable?
You mean the difference between:
final class C : I {...}
// this
I i
Is there any loss in performance instantiating an interface
variable as a final class implementing only that interface, as
opposed to a class variable?
On Friday, 12 July 2013 at 05:13:44 UTC, Jonathan M Davis wrote:
On Friday, July 12, 2013 07:03:07 Daniel Kozak wrote:
Are all methods in final class non-virtual or must be explicity
marked as a final too?
They're virtual if they override base class functions, but
they're defi
On Friday, July 12, 2013 07:03:07 Daniel Kozak wrote:
> Are all methods in final class non-virtual or must be explicity
> marked as a final too?
They're virtual if they override base class functions, but they're definitely
all final. So, the compiler _should_ optimize the func
Are all methods in final class non-virtual or must be explicity
marked as a final too?
On Thursday, August 19, 2010 08:23:42 Simen kjaeraas wrote:
> A destructor is always final, and private destructors make no sense,
> so I would say the attributes should not be there.
Actually, I could see private destructors making at least some sense.
Obviously,
the runtime needs to be able to
Simen kjaeraas:
> A destructor is always final, and private destructors make no sense,
> so I would say the attributes should not be there.
Thank you for your answer, I have added the test case to bug 3934
Bye,
bearophile
bearophile wrote:
According to TDPL the whole object destructor chain is called up to the
top of the hyerarchy.
This D2 program compiles and runs with DMD 2.048 with no errors:
import std.c.stdio: puts;
class Base {
private final ~this() { puts("Base.~this"); }
}
class Derived : Base {
According to TDPL the whole object destructor chain is called up to the top of
the hyerarchy.
This D2 program compiles and runs with DMD 2.048 with no errors:
import std.c.stdio: puts;
class Base {
private final ~this() { puts("Base.~this"); }
}
class Derived : Base {
private final ~thi
18 matches
Mail list logo