Lately I've been getting very excited about the support for lambdas in VC2010. I'm slowly starting to grasp the full potential this feature has in transforming C++ into something alot better.
But then I realized that this potential greatly depends on main stream support of lambdas in day to day libraries like boost and QT.
Does anyone know if there are plans to extend these libraries with the new features of C++0x?
lambdas practically replace the need for boost::lambda and everything in boost that interacts with it.
QT could add support for lambdas in all of their container and maybe even as an alternative way of defining SLOT
s
Lambdas already fit very well into existing libraries - anywhere that a function accepts a function object of a type given by a template parameter.
This is one of the great things about them - they're a classic example of a language feature that codifies existing practice in a nifty syntax.
Obviously the boost lambda library becomes redundant, but that means it doesn't require any new features to be added to it.
I don't see how usage of lambda depends on support by libraries. Lambdas eliminate the need to create many classes just to wrap different small algorithms and neatly fit together with other language/library features (std::function
comes to mind). Wherever you used to pass either a function object or a function pointer, lambdas can be used, too.
So they mainly add another alternative for making use of existing code and libraries. The only way I can see for libraries to better support lambda is use more functional-style approaches.
Chances are such libraries are going to wait until there's proper compiler support for the relevant C++0x features , and not bother much with it until the mainstream compilers do support it. Don't hold your breath.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With