kyopro-lib

This documentation is automatically generated by online-judge-tools/verification-helper

View on GitHub

:question: join function
(Mylib/IO/join.cpp)

Operations

Requirements

Notes

Problems

References

Verified with

Code

#pragma once
#include <iostream>
#include <sstream>
#include <string>

namespace haar_lib {
  template <typename Iter>
  std::string join(Iter first, Iter last, std::string delim = " ") {
    std::stringstream s;

    for (auto it = first; it != last; ++it) {
      if (it != first) s << delim;
      s << *it;
    }

    return s.str();
  }
}  // namespace haar_lib
#line 2 "Mylib/IO/join.cpp"
#include <iostream>
#include <sstream>
#include <string>

namespace haar_lib {
  template <typename Iter>
  std::string join(Iter first, Iter last, std::string delim = " ") {
    std::stringstream s;

    for (auto it = first; it != last; ++it) {
      if (it != first) s << delim;
      s << *it;
    }

    return s.str();
  }
}  // namespace haar_lib
Back to top page