MCPcopy Create free account
hub / github.com/Kitware/CMake / NormalizeIndex

Method NormalizeIndex

Source/cmList.cxx:304–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302 }
303
304 index_type NormalizeIndex(index_type index, std::size_t count)
305 {
306 if (index < 0) {
307 index = static_cast<index_type>(count) + index;
308 }
309 if (index < 0 || count <= static_cast<std::size_t>(index)) {
310 throw transform_error(cmStrCat(
311 "sub-command TRANSFORM, selector ", this->Tag, ", index: ", index,
312 " out of range (-", count, ", ", count - 1, ")."));
313 }
314 return index;
315 }
316};
317class TransformSelectorAt : public TransformSelectorIndexes
318{

Callers 2

ValidateMethod · 0.80
ValidateMethod · 0.80

Calls 2

transform_errorClass · 0.85
cmStrCatFunction · 0.70

Tested by

no test coverage detected