| 518 | |
| 519 | // A specialization of vector_to_string to work around std::to_chars being unavailable for float on clang |
| 520 | template <int N> std::string float_vector_to_string(dm::vector<float, N> v) |
| 521 | { |
| 522 | std::string result; |
| 523 | for (int i = 0; i < N; ++i) |
| 524 | { |
| 525 | char buff[16] = { 0 }; |
| 526 | int c = snprintf(buff, sizeof(buff), "%f", v[i]); |
| 527 | |
| 528 | if (c < sizeof(buff)) |
| 529 | { |
| 530 | if (i < (N - 1)) |
| 531 | buff[strlen(buff)] = ' '; |
| 532 | |
| 533 | result += buff; |
| 534 | } |
| 535 | } |
| 536 | return result; |
| 537 | } |
| 538 | |
| 539 | std::string float_to_string(float v) |
| 540 | { |