mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
test: delegate: add unary + to convert lambda to function pointer
This commit is contained in:
parent
ea397ec2dd
commit
1ce3deb0f7
@ -676,7 +676,8 @@ namespace
|
||||
{
|
||||
etl::delegate<int(int, int)> d;
|
||||
|
||||
d.set([](int i, int j) { function_called = FunctionCalled::Lambda_Called; parameter_correct = (i == VALUE1) && (j == VALUE2); return i + j + 6; });
|
||||
d.set(+[](int i, int j)
|
||||
{ function_called = FunctionCalled::Lambda_Called; parameter_correct = (i == VALUE1) && (j == VALUE2); return i + j + 6; });
|
||||
|
||||
int result = d(VALUE1, VALUE2);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user