aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/www/concat_strings.h
blob: 77a77d46953763f6d149f3b3da8e3de6f6c4c07e (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();
}