Created
October 7, 2015 07:41
-
-
Save markpapadakis/5eb016935423fddaf03e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 will crash clang++-3.7 | |
std::sort(list->begin(), list->end(), [](const fixup_candidate &c1, const fixup_candidate &c2) | |
{ | |
if (c2.rangeSpan < c1.rangeSpan) | |
return true; | |
else if (c2.rangeSpan == c1.rangeSpan) | |
return c2.candiate.len < c1.candidate.len; | |
else | |
return false; | |
}); | |
// This works fine | |
std::sort(list->begin(), list->end(), [](const fixup_candidate &c1, const fixup_candidate &c2) | |
{ | |
return c2.rangeSpan < c1.rangeSpan || (c2.rangeSpan == c1.rangeSpan && c2.candidate.len < c1.candidate.len); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment