C++ delegates
2006-01-09 16:08:00.735072+01 by
Dan Lyke
4 comments
C++ trick of the day: The Impossibly Fast C++ Delegates By Sergey Ryazanov. Summary: Use templates to create a static function which does a static_cast on a void * and then dispatches a method on it, and pass around the void * and a pointer to this function. Gives a pointer to a member function that does all the right things, including dispatching virtually, and even from a pure virtual.
[ related topics:
Software Engineering Cool Technology
]
comments in descending chronological order (reverse):
#Comment Re: made: 2006-01-13 05:05:47.341847+01 by:
DaveP
I've been seeing good things from a combination of Obj-C++ and Lua around the office, too.
#Comment Re: [Entry #8533] Re: made: 2006-01-13 03:06:03.125704+01 by:
Unknown, from NNTP
FWIW, the Feb issue of Linux Journal had a nice article about
embedding the Python interpreter in a C/C++ program, and how you go
about actually using it once it's embedded.
#Comment Re: made: 2006-01-12 22:52:58.862044+01 by:
Dan Lyke
Yeah, the problem with C++ is that it sucks slightly less than all of the other solutions. And it's not really a language, it's a language construction kit.
But it gives you so much more than C, and has performance that Python
and Perl
don't match (and Java
and C# aren't in the running, so don't even bother mentioning them), that... well... sometimes you gotta dance with the devil.
#Comment Re: made: 2006-01-12 22:28:13.127122+01 by:
baylink
"If a programmer can simulate a construct faster than the compiler can implement it, then the compiler writer has blown it *badly*."
Guy L Steele, I think.
We will not edit your comments. However, we may delete your
comments, or cause them to be hidden behind another link, if we feel
they detract from the conversation. Commercial plugs are fine,
if they are relevant to the conversation, and if you don't
try to pretend to be a consumer. Annoying endorsements will be deleted
if you're lucky, if you're not a whole bunch of people smarter and
more articulate than you will ridicule you, and we will leave
such ridicule in place.