#include <iostream>
#include <vector>
#include <algorithm>
const std::string delimiter = std::string(40, '-');
void display(std::vector<std::string>& vec) {
std::cout << delimiter << std::endl;
std::for_each(vec.begin(), vec.end(),
[](std::string s) { std::cout << s << std::endl; });
std::cout << delimiter << std::endl;
}
int main()
{
std::vector<std::string> friends{ "Frank", "Bernhard", "Thomas", "Michael", "Janusch" };
std::cout << "Unsortiert!\n";
display(friends);
std::cout << "Sortiert alphabetisch!\n";
std::sort(friends.begin(), friends.end());
display(friends);
std::cout << "Sortiert nach Länge des Namens!\n";
std::sort(friends.begin(), friends.end(),
[](const auto& first, const auto& second) { return first.size() < second.size(); });
display(friends);
}