Browse DevX
Sign up for e-mail newsletters from DevX


Creating Unnamed Functions with the Lambda Library

Defining an unnamed function directly on the call site of an algorithm can be very useful but is it even possible? Yes it is! Find out how using lambda expressions can simplify your use of STL algorithms.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

A lambda expression enables you to define an unnamed function—directly on the call site of an algorithm. Such unnamed functions are chiefly useful in functional programming, generic libraries, and scientific applications. However, even mainstream C++ applications can benefit from the higher-order programming concepts of lambda abstractions. The following sections show how TR1's lambda library can simplify the usage of STL algorithms.

How can you create small, unnamed functions directly on the call site of an STL algorithm?

Use the lambda library for implementing lambda functors.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date