Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7683 Discussions

c++ 0x and Lambda functions extension

max-divulskiy
Beginner
230 Views
Good afternoon.

Tell me please when will be a possibility to use template lambda function in Intel compiler?
0 Kudos
6 Replies
Judith_W_Intel
Employee
230 Views
Can you point to a document on this extension please? Not sure what you're referring to...

thanks
Judy
max-divulskiy
Beginner
230 Views
If it is possible to write lambda function why it is impossible to write a template lambda function?

Unfortunately it while is not present, but hands and ask to write template =)

Whether it is necessary to expect such extension in the near future?
Judith_W_Intel
Employee
230 Views
One already can use template arguments from the outer function toa lambda function. Can you show
an example of what you're trying to do? Sincelambdas are not really functions, i.e. they can only becalled from oneplace(at the point of the definition) what would be the purposein makingthem templates?

Anywaythis is really a question for the C++ standards committee. Intel has implemented what's described in the C++0x standard.
max-divulskiy
Beginner
230 Views
I mean something that =)

[bash]template
Type lambdaSum = [&](Type x, Type y)
{
    return x + y;
};[/bash]
Judith_W_Intel
Employee
230 Views

Thisdoesn't look like a lambda since lambdas don't have names and can't be "called" like a function. This looks more like a template function that's trying to use lambda syntax for the parameter types.

Judy
max-divulskiy
Beginner
230 Views
Thanks for answers.
Reply