C++ Lambda Mixer

Lambdas are delivering good and quick and simple C++. But , contrary to Functional Programming aficionados, you still need good old structs or classes. Here is the simple solution, with which you can achieve:

  • mixing lambdas into structure at run-time
  • polymorphic behavior without inheritance.


This solution is simple because it is not pathologically generic.  For different struct you will need to code different mixer. If you expect hundreds of mixers this is not for you.  Which, I very much doubt.

DBJ lambda mixer in action is here. (Wandbox). The code is also here:

Enjoy.  As ever, comments bellow please.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.