ПК
get_separator(int index)
, можно лямбдойИ потом что то типа:
std::string join(Args&& ... args) {
int i = 0;
return Open + (... + (fmt::to_string(std::forward<decltype(args)>(args))+get_separator(++i))) + Close;
}
Size: a a a
ПК
get_separator(int index)
, можно лямбдойstd::string join(Args&& ... args) {
int i = 0;
return Open + (... + (fmt::to_string(std::forward<decltype(args)>(args))+get_separator(++i))) + Close;
}
D
ПК
get_separator(int index)
, можно лямбдойstd::string join(Args&& ... args) {
int i = 0;
return Open + (... + (fmt::to_string(std::forward<decltype(args)>(args))+get_separator(++i))) + Close;
}
DP
template<typename T, typename... Ts>
auto Join(const T& t, const Ts&... ts) {
std::string result = t;
return (..., ((result += ':') += ts));
}
Е
get_separator(int index)
, можно лямбдойstd::string join(Args&& ... args) {
int i = 0;
return Open + (... + (fmt::to_string(std::forward<decltype(args)>(args))+get_separator(++i))) + Close;
}
AB
DP
ПК
std::string
. Для маленькой строки не будет алокаций всё равноЕ
template<typename T, typename... Ts>
auto Join(const T& t, const Ts&... ts) {
std::string result = t;
return (..., ((result += ':') += ts));
}
Е
s
AB
template<typename T, typename... Ts>
auto Join(const T& t, const Ts&... ts) {
std::string result = t;
return (..., ((result += ':') += ts));
}
DP
AB
AB
template<typename T, typename... Ts>
auto Join(const T& t, const Ts&... ts) {
std::string result = t;
return (..., ((result += ':') += ts));
}
AB
Е
AB
Е
DP
return (..., ((result += ':') += ts)), result;