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

前端 未结 11 1456
隐瞒了意图╮
隐瞒了意图╮ 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:56

    I would vote for Sigslots, I have tried a couple of the other alternatives (boost, libsig++, FastDelegates) and none seemed to do just what I wanted: binding functions together in an anonymous way with automatic on-object-destruction disconnect.

    Sigslots was great for us because it is perfectly readable C++, it is fast, simple, and does the job without getting in the way. One minor thing, if you want to use it from several libraries you might need to add:

    COREEXTERN template class COREIMPEXP has_slots;
    

    to avoid already-defined-object-related linking issues.

提交回复
热议问题