digitalmars.D - from C++ to D...
- Regan Heath (19/19) Jun 13 2004 This is a C++ struct..
- Sam McCall (10/25) Jun 13 2004 struct bob {
- Regan Heath (7/31) Jun 13 2004 Thanks. :)
This is a C++ struct.. struct bob { void check1(void *blert) { ..etc.. } void (bob::*check2(void *blart))(void *) { ..etc.. return check1; } }; how do I write that in D? It is a function that takes a void * and returns a function that takes a void * I know I use delegate, but how. :) Thanks in advance. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 13 2004
Regan Heath wrote:This is a C++ struct.. struct bob { void check1(void *blert) { ..etc.. } void (bob::*check2(void *blart))(void *) { ..etc.. return check1; } }; how do I write that in D?struct bob { void check1(void* blert) { } void delegate(void *) check2(void* blart) { return &check1; } } I think that's right... much easier on the eyes :-) Sam
Jun 13 2004
On Mon, 14 Jun 2004 17:49:40 +1200, Sam McCall <tunah.d tunah.net> wrote:Regan Heath wrote:Thanks. :) I should have worked it out, for some reason I just couldn't my brain is still programmed for C/C++ I'm afraid. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/This is a C++ struct.. struct bob { void check1(void *blert) { ..etc.. } void (bob::*check2(void *blart))(void *) { ..etc.. return check1; } }; how do I write that in D?struct bob { void check1(void* blert) { } void delegate(void *) check2(void* blart) { return &check1; } } I think that's right... much easier on the eyes :-)
Jun 13 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kmlcn75a2sq9 digitalmars.com...I should have worked it out, for some reason I just couldn't my brain is still programmed for C/C++ I'm afraid.At some point, you'll find you can't go back to C++ <g>.
Jun 14 2004
"Walter" <newshound digitalmars.com> wrote in message news:cajj1r$2sqp$1 digitaldaemon.com..."Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kmlcn75a2sq9 digitalmars.com...When's that then? <g> I have to say, though, that I've been inspired by D to introduce various things into C++ libraries to give the same functionality.I should have worked it out, for some reason I just couldn't my brain is still programmed for C/C++ I'm afraid.At some point, you'll find you can't go back to C++ <g>.
Jun 14 2004