concat_strings.h 548 B

12345678910111213141516171819202122
  1. #pragma once
  2. #include <util/generic/string.h>
  3. #include <util/stream/str.h>
  4. // ATTN: not equivalent to TString::Join - cat concat anything "outputable" to stream, not only TString convertable types.
  5. inline void DoConcatStrings(TStringStream&) {
  6. }
  7. template <class T, class... R>
  8. inline void DoConcatStrings(TStringStream& ss, const T& t, const R&... r) {
  9. ss << t;
  10. DoConcatStrings(ss, r...);
  11. }
  12. template <class... R>
  13. inline TString ConcatStrings(const R&... r) {
  14. TStringStream ss;
  15. DoConcatStrings(ss, r...);
  16. return ss.Str();
  17. }