-
-
Notifications
You must be signed in to change notification settings - Fork 234
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 #348 from andreasfertig/fixIssue347
Fixed #347: Use `const &` or `&/&&` as constructor parameters for lambdas
- Loading branch information
Showing
21 changed files
with
162 additions
and
146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <string> | ||
|
||
int main() { | ||
std::string str {"Hello World"}; | ||
auto foo = [str]() { }; | ||
} |
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,25 @@ | ||
#include <string> | ||
|
||
int main() | ||
{ | ||
std::string str = std::basic_string<char>{"Hello World"}; | ||
|
||
class __lambda_5_12 | ||
{ | ||
public: | ||
inline /*constexpr */ void operator()() const | ||
{ | ||
} | ||
|
||
private: | ||
std::basic_string<char> str; | ||
public: | ||
__lambda_5_12(const std::basic_string<char> & _str) | ||
: str{_str} | ||
{} | ||
|
||
}; | ||
|
||
__lambda_5_12 foo = __lambda_5_12{str}; | ||
} | ||
|
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,6 @@ | ||
#include <string> | ||
|
||
int main() { | ||
const std::string str {"Hello World"}; | ||
auto foo = [str]() { }; | ||
} |
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,25 @@ | ||
#include <string> | ||
|
||
int main() | ||
{ | ||
const std::string str = std::basic_string<char>{"Hello World"}; | ||
|
||
class __lambda_5_12 | ||
{ | ||
public: | ||
inline /*constexpr */ void operator()() const | ||
{ | ||
} | ||
|
||
private: | ||
const std::basic_string<char> str; | ||
public: | ||
__lambda_5_12(const const std::basic_string<char> & _str) | ||
: str{_str} | ||
{} | ||
|
||
}; | ||
|
||
__lambda_5_12 foo = __lambda_5_12{str}; | ||
} | ||
|
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 |
---|---|---|
|
@@ -38,7 +38,7 @@ class __lambda_5_11 | |
int a; | ||
|
||
public: | ||
__lambda_5_11(int _a) | ||
__lambda_5_11(const int & _a) | ||
: a{_a} | ||
{} | ||
|
||
|
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ int main() | |
int x; | ||
|
||
public: | ||
__lambda_7_14(int _x) | ||
__lambda_7_14(int & _x) | ||
: x{_x} | ||
{} | ||
|
||
|
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ int main() | |
|
||
} __lambda_5_7{}; | ||
|
||
S _s) | ||
const S & _s) | ||
: s{_s} | ||
{} | ||
|
||
|
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,5 @@ | ||
int main() | ||
{ | ||
const char a{ 2 }; | ||
auto&& l=[ uuu = a]{ }; | ||
} |
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,24 @@ | ||
int main() | ||
{ | ||
const char a = {2}; | ||
|
||
class __lambda_4_11 | ||
{ | ||
public: | ||
inline /*constexpr */ void operator()() const | ||
{ | ||
} | ||
|
||
private: | ||
char uuu; | ||
|
||
public: | ||
__lambda_4_11(const char & _uuu) | ||
: uuu{_uuu} | ||
{} | ||
|
||
}; | ||
|
||
__lambda_4_11 && l = __lambda_4_11{a}; | ||
} | ||
|
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.