| 37 | namespace aux { |
| 38 | |
| 39 | allocation_slot stack_allocator::copy_string(string_view str) |
| 40 | { |
| 41 | auto const ret = m_storage.size(); |
| 42 | if (std::numeric_limits<int>::max() - str.size() <= ret) |
| 43 | return {}; |
| 44 | m_storage.resize(ret + str.size() + 1); |
| 45 | std::memcpy(&m_storage[ret], str.data(), str.size()); |
| 46 | m_storage[ret + str.length()] = '\0'; |
| 47 | return allocation_slot(ret); |
| 48 | } |
| 49 | |
| 50 | allocation_slot stack_allocator::copy_string(char const* str) |
| 51 | { |