Use std::begin and std::end
This makes it clear that they are standard functions.
This commit is contained in:
@ -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++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user