I'm trying to base my application on callback. The most troubling issue to me is that I have to specify what the Lambda function takes. My base class, which extends all others, specifies two basic types:
class callback {typed function & lt; Void () & gt; Ceremony; Typingf vector & lt; Pair & lt; String, vector & lt; Function & gt; & Gt; & Gt; CallbackContainer; Public: zero callback (string); // Both types are used Is it possible to change the log of the lambda function (this function type)? Or does the code use the original type in the callback method? If so, can I apply the new type of code without copying and pasting the code? Just to complete the dry.
types are not virtual; You can not "override" them in a derived category.
With a little limited understanding of what you are trying to do, I think you should make a callback a template. Something like this: template & lt; Typename ArgType & gt; Class callback {typed functions & lt; Void (ArgType) & gt; Ceremony; Typingf vector & lt; Pair & lt; String, vector & lt; Function & gt; & Gt; & Gt; CallbackContainer; Public: zero callback (string); // Both types are used This task is only for those tasks that surely take an argument, of course. To make this even more common in current day C ++ is far from trivial; In C ++ 0x it becomes slightly easier with varied templates.
Perhaps you can see Boost, though. A good opportunity is that you can already use something present there.
Comments
Post a Comment