sigc unbind? (or, deconstruct a functor?)

旧时模样 提交于 2019-12-13 04:35:14

问题


Suppose I have used sigc::bind to construct a callback functor. Suppose I have registered that callback with another class -- in my case it's a scheduling class. At the right time, the scheduling class will call my callback, with all the correctly-bound arguments. And that works fine.

But suppose I want a debugging interface on that other class, that will give me my callbacks back (as data objects, that is, not by calling them). That is, in the case of the scheduling class, suppose I want a way to dump the schedule. It'd be straightforward, I think, to have the other class (the scheduling class) hand me back the same callbacks I handed it -- but what do I do with those callbacks? Even if I know I used sigc::bind to bind together two or three arguments into each callback, how do I pick one apart to get my two or three things back?

I think I'm looking for something along the lines of sigc::unbind, but I have no idea whether such a thing exists (or can exist), or even what to call it.

来源:https://stackoverflow.com/questions/57879245/sigc-unbind-or-deconstruct-a-functor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!