What light library of events / delegates (signal / slot) C ++ should I choose?

I know that the question has already been asked and answered, but more than a year ago, and it seems that there are new alternatives.

So, I encode the game using the SFML library (which I find pretty cool right now) m is looking for an easy and fast event / delegate library.

After some research and discarding the classic ones ( Boosts.Signals , libsig ++ ), I found " cpp-events ". This is not very popular right now, as it is a very recent library, but it seems to be the worst of all to be tested. I would be very interested to know someone tried here and can give a little feedback.

Do you have any other similar (or better) options to offer? I look at quite real projects (which will be supported) than the answers on the forums.

Thanks!

+7
c ++ signals-slots
source share
2 answers

I feel that http://www.codeproject.com/KB/cpp/ImpossiblyFastCppDelegate.aspx is a great implementation for games. Dynamic memory allocation, reasonable performance, ease of debugging => great for games.

I have used similar delegates in the past, this implementation looks more efficient.

The one you suggested indicates thread safety, but I would be embarrassed to use the delegate-based interface used between threads. This may work fine on a small project, but if the team grows, it can also lead to disaster. I would also question the performance implications of such a feature.

+3
source share

Also check out Boost.Signals2 , which is a thread safe version of Boost.Signals. I use it at work in a medium-sized project, and I'm quite happy with it.

+3
source share

All Articles