aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/www/concat_strings.h
blob: 7b730564ebb48d6b8319ab64e0d8d3868c524a58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <util/generic/string.h>
#include <util/stream/str.h>

// ATTN: not equivalent to TString::Join - cat concat anything "outputable" to stream, not only TString convertable types.

inline void DoConcatStrings(TStringStream&) {
}

template <class T, class... R>
inline void DoConcatStrings(TStringStream& ss, const T& t, const R&... r) {
    ss << t;
    DoConcatStrings(ss, r...);
}

template <class... R>
inline TString ConcatStrings(const R&... r) {
    TStringStream ss;
    DoConcatStrings(ss, r...);
    return ss.Str();
}