lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange construct


From: Ralph Little
Subject: Strange construct
Date: Mon, 08 Oct 2007 23:44:26 -0700
User-agent: Thunderbird 1.5.0.13 (X11/20070824)

Hi,
Sorry for my C++ ignorance, but what does the following do?

=========================================
void
performer_each (SCM list, Performer_method method)
{
 for (SCM p = list; scm_is_pair (p); p = scm_cdr (p))
   {
Performer *e = dynamic_cast<Performer *> (unsmob_translator (scm_car (p)));
     if (e)
   (e->*method) ();
   }
}
=========================================

I'm particularly interested in this strange construct:
   (e->*method) ();

I can see that (e->*method) must yield a function pointer, but the best I can come up with is that 'method' is somehow a pointer to a class member function which is transposed with the last derived version from the type that e is, because if 'method' was a function pointer, then surely (*method)() would be sufficient (?)

Sorry but this just blows my mind...and it is a bit late here....

Regards,
Ralph











reply via email to

[Prev in Thread] Current Thread [Next in Thread]