11 #ifndef TLX_STRING_JOIN_GENERIC_HEADER 12 #define TLX_STRING_JOIN_GENERIC_HEADER 33 template <
typename Glue,
typename Iterator>
35 std::string
join(Glue glue, Iterator first, Iterator last) {
36 std::ostringstream out;
37 if (first == last)
return out.str();
60 template <
typename Container>
62 std::string
join(
char glue,
const Container& parts) {
63 return join(glue, std::begin(parts), std::end(parts));
74 template <
typename Container>
76 std::string
join(
const char* glue,
const Container& parts) {
77 return join(glue, std::begin(parts), std::end(parts));
88 template <
typename Container>
90 std::string
join(
const std::string& glue,
const Container& parts) {
91 return join(glue, std::begin(parts), std::end(parts));
99 #endif // !TLX_STRING_JOIN_GENERIC_HEADER
std::string join(char glue, const std::vector< std::string > &parts)
Join a vector of strings by some glue character between each pair from the sequence.