* @pre @p pos >= 0 * @return a string view starting at position @p pos in @p view and extending to its end, * or an empty string view if @p pos exceeds the length of @p view */
| 18 | * or an empty string view if @p pos exceeds the length of @p view |
| 19 | */ |
| 20 | constexpr QStringView slicedOrEmptyView(QStringView view, qsizetype pos) |
| 21 | { |
| 22 | Q_ASSERT(pos >= 0); |
| 23 | return pos < view.size() ? view.sliced(pos) : QStringView{}; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * @pre @p offset >= 0 |
no test coverage detected