| 44 | |
| 45 | template <typename... Args> |
| 46 | std::string JoinToString(Args&&... args) { |
| 47 | StringStreamWrapper ss; |
| 48 | ( |
| 49 | [&ss](auto&& arg) { |
| 50 | // Avoid losing precision when printing floating point numbers |
| 51 | if constexpr (std::is_floating_point_v<std::decay_t<decltype(arg)>>) { |
| 52 | ss.stream() << std::to_string(arg); |
| 53 | } else { |
| 54 | ss.stream() << arg; |
| 55 | } |
| 56 | }(std::forward<Args>(args)), |
| 57 | ...); |
| 58 | return ss.str(); |
| 59 | } |
| 60 | } // namespace internal |
| 61 | |
| 62 | namespace util { |
no test coverage detected