| 154 | } |
| 155 | |
| 156 | ada_really_inline constexpr std::string_view substring(std::string_view input, |
| 157 | size_t pos) { |
| 158 | ADA_ASSERT_TRUE(pos <= input.size()); |
| 159 | // The following is safer but unneeded if we have the above line: |
| 160 | // return pos > input.size() ? std::string_view() : input.substr(pos); |
| 161 | return input.substr(pos); |
| 162 | } |
| 163 | |
| 164 | ada_really_inline void resize(std::string_view& input, size_t pos) noexcept { |
| 165 | ADA_ASSERT_TRUE(pos <= input.size()); |