Use std::begin and std::end

This makes it clear that they are standard functions.
This commit is contained in:
Markus Mäkelä
2019-04-02 13:55:58 +03:00
parent 5242cd5ebf
commit cc1b8b2d56

View File

@ -182,13 +182,13 @@ template<class T>
std::string join(const T& container, const std::string& separator = ",") std::string join(const T& container, const std::string& separator = ",")
{ {
std::stringstream ss; std::stringstream ss;
auto it = begin(container); auto it = std::begin(container);
if (it != end(container)) if (it != std::end(container))
{ {
ss << *it++; ss << *it++;
while (it != end(container)) while (it != std::end(container))
{ {
ss << separator << *it++; ss << separator << *it++;
} }