-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from andreasfertig/fixIssue46
Fixed issue #46: Lambda's in global scope.
- Loading branch information
Showing
6 changed files
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
auto x = []() { | ||
return 5; | ||
}; | ||
|
||
auto x2 = [a=5](int b) { | ||
return b*a; | ||
}; | ||
|
||
int main() | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
class __lambda_1_10 | ||
{ | ||
public: inline /*constexpr */ int operator()() const | ||
{ | ||
return 5; | ||
} | ||
|
||
}; | ||
|
||
__lambda_1_10 x = __lambda_1_10{}; | ||
|
||
|
||
|
||
class __lambda_5_11 | ||
{ | ||
public: inline /*constexpr */ int operator()(int b) const | ||
{ | ||
return b * a; | ||
} | ||
|
||
private: | ||
int a; | ||
|
||
public: __lambda_5_11(int _a) | ||
: a{_a} | ||
{} | ||
|
||
}; | ||
|
||
__lambda_5_11 x2 = __lambda_5_11{5}; | ||
|
||
|
||
int main() | ||
{ | ||
} | ||
|