Greetings
<div><br></div><div>I am facing problem passing a shared class method as an argument to a function. Look at the following minimized code snippet.</div><div><br></div><div><div>class Foo {</div><div>  shared // compiles when commented out</div>

<div>    void bar() {}</div><div>}</div><div><br></div><div>void frop(void delegate() dg) {</div><div>}</div><div><br></div><div>void main() {</div><div>  shared Foo foo = new shared(Foo);</div><div>  frop(&foo.bar);</div>

<div>}</div></div><div><br></div><div>I get the following errors (using dmd 2.052)</div><div><div>dg.d(11): Error: function dg.frop (void delegate() dg) is not callable using argument types (void delegate() shared)</div>
<div>
dg.d(11): Error: cannot implicitly convert expression (&foo.bar) of type void delegate() shared to void delegate()</div></div><div><br></div><div>Please suggest a valid signature for the function frop, so that it can take shared delegates.</div>

<div><br></div><div>Regards</div><div>- Puneet</div>