| 727 | // standard library runtime. std::decay is used for back_inserter to be found by |
| 728 | // ADL when applied to memory_buffer. |
| 729 | template <typename T> struct allocator : private std::decay<void> { |
| 730 | using value_type = T; |
| 731 | |
| 732 | auto allocate(size_t n) -> T* { |
| 733 | FMT_ASSERT(n <= max_value<size_t>() / sizeof(T), ""); |
| 734 | return static_cast<T*>(detail::allocate(n * sizeof(T))); |
| 735 | } |
| 736 | |
| 737 | void deallocate(T* p, size_t) { free(p); } |
| 738 | |
| 739 | constexpr friend auto operator==(allocator, allocator) noexcept -> bool { |
| 740 | return true; // All instances of this allocator are equivalent. |
| 741 | } |
| 742 | constexpr friend auto operator!=(allocator, allocator) noexcept -> bool { |
| 743 | return false; |
| 744 | } |
| 745 | }; |
| 746 | |
| 747 | template <typename Formatter> |
| 748 | FMT_CONSTEXPR auto maybe_set_debug_format(Formatter& f, bool set) |