| 515 | |
| 516 | template<typename T> |
| 517 | fl::string to_hex(T value, bool uppercase, bool pad_to_width) FL_NOEXCEPT { |
| 518 | constexpr auto width = detail::get_hex_int_width<sizeof(T)>(); |
| 519 | bool is_negative = false; |
| 520 | u64 unsigned_value; |
| 521 | if (static_cast<i64>(value) < 0 && sizeof(T) <= 8) { |
| 522 | is_negative = true; |
| 523 | unsigned_value = static_cast<u64>(-static_cast<i64>(value)); |
| 524 | } else { |
| 525 | unsigned_value = static_cast<u64>(value); |
| 526 | } |
| 527 | return detail::hex(unsigned_value, width, is_negative, uppercase, pad_to_width); |
| 528 | } |
| 529 | |
| 530 | // Comparator that orders strings by size first, then by content. |
| 531 | // Not lexicographic — use only for associative containers (flat_map, etc.) |
no test coverage detected