Note that there are some explanatory texts on larger screens.

plurals
  1. PO5 years later, is there something better than the "Fastest Possible C++ Delegates"?
    text
    copied!<p>I know that the topic of "C++ delegates" has been done to death, and both <a href="http://www.codeproject.com" rel="noreferrer">http://www.codeproject.com</a> and <a href="http://stackoverflow.com">http://stackoverflow.com</a> deeply cover the question. </p> <p>Generally, it seems that <a href="http://www.codeproject.com/KB/cpp/FastDelegate.aspx" rel="noreferrer">Don Clugston's fastest possible delegate</a> is the first choice for many people. There are a few other popular ones.</p> <p>However, I noticed that most of those articles are old (around 2005) and many design choices seem to have been made taking in account old compilers like VC7.</p> <p>I'm in need of a very fast delegate implementation for an audio application. </p> <p>I still need it to be portable (Windows, Mac, Linux) but I only use modern compilers (VC9, the one in VS2008 SP1 and GCC 4.5.x). </p> <p>My main criteria are:</p> <ul> <li>it must be fast! </li> <li>it must be forward-compatible with newer versions of the compilers. I have some doubts about that with Don's implementation because he explicitly states it's not standard-compliant.</li> <li>optionally, a KISS-syntax and ease-of-use is nice to have</li> <li>multicast would be nice, although I'm convinced it's really easy to build it around any delegate library</li> </ul> <p>Furthermore, I don't really need exotic features. I just need the good old pointer-to-method thing. No need to support static methods, free functions or things like that.</p> <p>As of today, what is the recommended approach? Still use <a href="http://www.codeproject.com/KB/cpp/FastDelegate.aspx" rel="noreferrer">Don's version</a>? Or is there a "community consensus" about another option? </p> <p>I really don't want to use Boost.signal/signal2 because it's not acceptable in terms of performance. A dependency on QT is not acceptable as well.</p> <p>Furthermore, I've seen some newer libraries while googling, like for example <a href="http://code.google.com/p/cpp-events/" rel="noreferrer">cpp-events</a> but I couldn't find any feedback from users, including on SO.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload