You can have lambdas in C++ with GCC and Boost even without C++11 support.

int val = 2;
int nums[] = {1, 2, 3};
int* end = nums + 3;
 
int* iter = std::find_if(nums, end,
    GCC_LAMBDA(const bind val, int num, return bool) {
        return num == val;
    } GCC_LAMBDA_END
);
The GCC lambda function macros are implemented using local functions.
You can read more on this here.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s