| 492 | } |
| 493 | |
| 494 | std::string string_repeat(const std::string & str, size_t n) { |
| 495 | if (n == 0) { |
| 496 | return ""; |
| 497 | } |
| 498 | |
| 499 | std::string result; |
| 500 | result.reserve(str.length() * n); |
| 501 | |
| 502 | for (size_t i = 0; i < n; ++i) { |
| 503 | result += str; |
| 504 | } |
| 505 | |
| 506 | return result; |
| 507 | } |
| 508 | |
| 509 | std::string string_from(bool value) { |
| 510 | return value ? "true" : "false"; |
no test coverage detected