# How to sort std::vectors
This is an example of how to sort file paths taking into accounta an alphabetical order.
```
// Sort the file list
std::sort(std::begin(filePathList), std::end(filePathList),
[](const std::string & lhs, const std::string & rhs) {
if (lhs.size() < rhs.size()) {
return true;
} else if (lhs.size() > rhs.size()) {
return false;
} else {
return fs::path(lhs).filename() <
fs::path(rhs).filename();
}
});
```