Messages and dynamic memory

Started by
9 comments, last by Hodgman 8 years, 4 months ago

While I support the notion above I would rather stay away from std::bind.

Me too smile.png I just wanted to use the std library there laugh.png
The lambda syntax from the 2nd example is also applicable to the first (and is probably more readable, and may even perform better...) -- In C++14 there is no reason to use bind instead of lambdas.

Personally I usually use C-style callbacks in my own code -- where Producer would have a raw function pointer, and an arbitrary void* "userdata" argument.

Virtual interfaces are also applicable if that's your fancy.

This topic is closed to new replies.

Advertisement