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