October 26, 2011 Re: What is shared functions? | ||||
---|---|---|---|---|
| ||||
Posted in reply to simendsjo | > void main() {
> shared s1 = cast(shared)new S();
> s1.onlyShared(); // ok
> //s1.notShared(); // error: not callable using argument types () shared
> auto s2 = new S();
> //s2.onlyShared(); // error: not callable using argument types ()
> s2.notShared(); // ok
> }
I would rather prefer "auto s1 = new shared(S);" because "shared s1 =
new S();" seems to allocate a TLS variable which is then casted to
shared which is actually non-TLS.
|
November 08, 2011 Re: What is shared functions? | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | Am 23.10.2011, 21:51 Uhr, schrieb bearophile <bearophileHUGS@lycos.com>:
> Jonathan M Davis:
>
>> my general take on it is that dmd should _never_ ignore attributes,
>
> I agree. Such sloppiness is a very good source for problems, long term ones too, and it makes it harder to learn D.
>
> Bye,
> bearophile
+1
For example I still wonder what final does to private methods. It makes me wonder if they are virtual and I should really add this keyword to be on the safe side.
|
Copyright © 1999-2021 by the D Language Foundation