Thursday, February 17, 2011

"Functionoids"?

I've read the description of "functionoids" here. They look like a poor-man's version of Boost::function and Boost::bind. Am I missing something? Is there a good reason to use them if you're already using Boost?

From stackoverflow
  • No.

    Alternatively see the FQA answer here.

  • Check this article about closure that might help you.

  • My vote goes to tr1::function.

    Functors or functionoids represent the base from which tr1/boost::function has evolved. The limit with common-interface functors is that they break the OO-paradigm since they represent different types and can only passed to template functions (unless you provide a base class from which they derive from).

    Indeed by means of the type erasure technique tr1::function overcomes this limit: They are best used to implement dynamic strategy classes.

0 comments:

Post a Comment