Which C++ signals/slots library should I choose?

前端 未结 11 1461
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 00:10

I want to use a signals/slots library in a project that doesn\'t use QT. I have pretty basic requirements:

  1. Connect two functions with any number of parameters
11条回答
  •  执念已碎
    2020-12-01 00:39

    Very, very fast event library on Gamedev.net forms

    When profiling some code I'd been working on recently, I was surprised and dismayed to see boost::signals functions floating to the top. For those of you who are unaware, boost::signals is a wonderfully useful signal/slot library which can be used alongside boost::bind for delegate-based event handling such as one sees in C#. It is robust, featureful, and flexible. It is also, I have learned, incredibly, terrifyingly slow. For a lot of people who use boost::signals this is fine because they call events very seldom. I was calling several events per frame per object, with predictable results.

    So I wrote my own. Slightly less flexible and featureful. It's optimized for how everyone tends to actually use events. And event invocation is fifteen to eighty times faster than boost::signals.

    see link

提交回复
热议问题