* @private * Return the substring from input going from index pos1 to the pos2 (non * included). The length of the substring is pos2 - pos1. */
| 105 | * included). The length of the substring is pos2 - pos1. |
| 106 | */ |
| 107 | ada_really_inline constexpr std::string_view substring(std::string_view input, |
| 108 | size_t pos1, |
| 109 | size_t pos2) { |
| 110 | #if ADA_DEVELOPMENT_CHECKS |
| 111 | if (pos2 < pos1) { |
| 112 | std::cerr << "Negative-length substring: [" << pos1 << " to " << pos2 << ")" |
| 113 | << std::endl; |
| 114 | abort(); |
| 115 | } |
| 116 | #endif |
| 117 | return input.substr(pos1, pos2 - pos1); |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * @private |
nothing calls this directly
no outgoing calls
no test coverage detected