-
-
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 #43 from andreasfertig/fixIssue41
Fixed Issue #41: Segfault with generic lambda.
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
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,13 @@ | ||
#include <vector> | ||
#include <algorithm> | ||
#include <string> | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
vector<string> v = { "aaa", "bbb", "ccc" }; | ||
|
||
auto it = std::find_if(begin(v), end(v), | ||
[](const auto & str){ return str == "bbb";} ); | ||
} |
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,22 @@ | ||
#include <vector> | ||
#include <algorithm> | ||
#include <string> | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
vector<std::string> v = std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > >{std::initializer_list<std::basic_string<char> >{std::basic_string<char>("aaa"), std::basic_string<char>("bbb"), std::basic_string<char>("ccc")}}; | ||
|
||
class __lambda_12_26 | ||
{ | ||
public: inline /*constexpr */ bool operator()(const std::basic_string<char> & str) const | ||
{ | ||
return operator==(str, "bbb"); | ||
} | ||
|
||
}; | ||
|
||
std::__wrap_iter<std::basic_string<char> *> it = std::find_if(std::begin(v), std::end(v), __lambda_12_26{}); | ||
} | ||
|