Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add sort for ListView #107
This definitely looks like a useful function.
Could you perhaps swap the parameters of the sort function (so first the index and then the comparator)? I think that it might be slightly more readably when calling the function with a lambda function as comparator.
I don't really like that both variables are initialized on one line, so maybe you could also either use a ternary operator (and make s1 and s2 const) or rewrite the function as follows?
sf::String s1; if (index < a.texts.size()) s1 = a.texts[index].getString(); sf::String s2; if (index < b.texts.size()) s2 = b.texts[index].getString();