4
// functions to split a string by a specific delimiter
10
// join a vector of elements by a delimiter object. ostream<< must be defined
11
// for both class S and T and an ostream, as it is e.g. in the case of strings
12
// and character arrays
13
template<class S, class T>
14
std::string join(std::vector<T>& elems, S& delim) {
16
typename std::vector<T>::iterator e = elems.begin();
18
for (; e != elems.end(); ++e) {
25
template<class S, class T>
26
std::string join(std::list<T>& elems, S& delim) {
28
typename std::list<T>::iterator e = elems.begin();
30
for (; e != elems.end(); ++e) {