| 67 | } |
| 68 | |
| 69 | std::tuple<std::string, std::string, std::string> partition(std::string str, std::string const& point) |
| 70 | { |
| 71 | std::tuple<std::string, std::string, std::string> ret; |
| 72 | |
| 73 | auto i = str.find(point); |
| 74 | |
| 75 | if (i == std::string::npos) { |
| 76 | // no match: string goes in 0th spot only |
| 77 | } else { |
| 78 | std::get<2>(ret) = str.substr(i + point.size()); |
| 79 | std::get<1>(ret) = point; |
| 80 | str.resize(i); |
| 81 | } |
| 82 | std::get<0>(ret) = std::move(str); |
| 83 | |
| 84 | return ret; |
| 85 | } |
| 86 | |
| 87 | template <typename I> |
| 88 | std::string join(I iter, I end, std::string const& delim) { |