Yes the understanding is correct. I simplified the code a little:
IMPORTANT: DMD 2.065 is used.
class Car{
void delegate() onEvent;
}
class Test{
this() shared
{
auto car = new shared Car();
assert( typeid( car.onEvent ).toString() == "shared(void
dele
On 06/16/2014 09:37 AM, Tolga Cakiroglu wrote:
> On Monday, 16 June 2014 at 15:25:51 UTC, Ali Çehreli wrote:
> Okay, now I continue with another thing. After defining the event
> attribute as follows
>
> public void delegate( shared(SocketListener) sender ) shared
> eventWhenStarted;
>
>
> ---
>
On Monday, 16 June 2014 at 15:25:51 UTC, Ali Çehreli wrote:
Here is a minimal example that reproduces the issue and the
hint that compiles the code:
class SocketListener
{
public void delegate( shared(SocketListener) sender )
/* shared */// <-- UNCOMMENT TO COMPILE
eventWhenSt
Thanks Ali. That has solved the problem. Actually I tried to use
that `shared` as follows before:
public shared void delegate( shared(BasicSocketListener) sender )
eventWhenStarted;
Though it didn't work with that. When it is put "before" the
attribute name, it works now. It is just confusin
On 06/16/2014 05:35 AM, Tolga Cakiroglu wrote:> In a class I defined an
event attribute as follows:
>
> public void delegate( shared(SocketListener) sender ) eventWhenStarted;
>
> ---
>
> An instance of SocketListener is created.
>
> auto listener = new shared SocketListener();
>
> ---
>
> I defi
In a class I defined an event attribute as follows:
public void delegate( shared(SocketListener) sender )
eventWhenStarted;
---
An instance of SocketListener is created.
auto listener = new shared SocketListener();
---
I defined a shared method that will be called when the event
occurs.