This is more C++-like:
struct size_less : Base
{
template<class T> bool operator()(T const &a, T const &b) const
{ return a.size() < b.size(); }
};
static size_t max_line_length(std::vector<std::string> const &lines)
{
return std::max_element(lines.begin(), lines.end(), size_less())->size();
}
This is more C++-like:
struct size_less : Base
{
template<class T> bool operator()(T const &a, T const &b) const
{ return a.size() < b.size(); }
};
static size_t max_line_length(std::vector<std::string> &lines)
{
return std::max_element(lines.begin(), lines.end(), size_less())->size();
}
This is more C++-like:
struct size_less
{
template<class T> bool operator()(T const &a, T const &b) const
{ return a.size() < b.size(); }
};
static size_t max_line_length(std::vector<std::string> const &lines)
{
return std::max_element(lines.begin(), lines.end(), size_less())->size();
}
This is more C++-like:
struct size_less : Base
{
template<class T> bool operator()(T const &a, T const &b) const
{ return a.size() < b.size(); }
};
static size_t max_line_length(std::vector<std::string> &lines)
{
return std::max_element(lines.begin(), lines.end(), size_less())->size();
}
lang-cpp