More lambda support - for optional lambda declarators
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@13859 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7ca8f025ad
commit
35458b4a5d
3 changed files with 33 additions and 12 deletions
|
|
@ -3292,18 +3292,23 @@ cpp_alternate_rettype : primitive_type { $$ = $1; }
|
|||
| decltype { $$ = $1; }
|
||||
;
|
||||
|
||||
/*
|
||||
Lambda functions and expressions, such as:
|
||||
auto myFunc = [](int x, int y) -> int { return x+y; };
|
||||
auto myFunc = [](int x, int y) { return x+y; };
|
||||
auto myFunc = [](int x, int y) { return x+y; }(1, 2);
|
||||
*/
|
||||
/* ------------------------------------------------------------
|
||||
Lambda functions and expressions, such as:
|
||||
auto myFunc = [] { return something; };
|
||||
auto myFunc = [](int x, int y) { return x+y; };
|
||||
auto myFunc = [](int x, int y) -> int { return x+y; };
|
||||
auto myFunc = [](int x, int y) throw() -> int { return x+y; };
|
||||
auto six = [](int x, int y) { return x+y; }(4, 2);
|
||||
------------------------------------------------------------ */
|
||||
cpp_lambda_decl : storage_class AUTO idcolon EQUAL lambda_introducer LPAREN parms RPAREN cpp_const lambda_body lambda_tail {
|
||||
$$ = 0;
|
||||
}
|
||||
| storage_class AUTO idcolon EQUAL lambda_introducer LPAREN parms RPAREN cpp_const ARROW type lambda_body lambda_tail {
|
||||
$$ = 0;
|
||||
}
|
||||
| storage_class AUTO idcolon EQUAL lambda_introducer lambda_body lambda_tail {
|
||||
$$ = 0;
|
||||
}
|
||||
;
|
||||
|
||||
lambda_introducer : LBRACKET {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue