Skip to content

Commit

Permalink
std.range.package: Add messages to assertions in chain
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Mar 21, 2021
1 parent f45aa83 commit 9bd2f2b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions std/range/package.d
Expand Up @@ -983,7 +983,7 @@ if (Ranges.length > 0 &&
source[i].popFront();
return;
}
assert(false);
assert(false, "Attempt to `popFront` of empty `chain` range");
}

@property auto ref front()
Expand All @@ -993,7 +993,7 @@ if (Ranges.length > 0 &&
if (source[i].empty) continue;
return fixRef(source[i].front);
}
assert(false);
assert(false, "Attempt to get `front` of empty `chain` range");
}

static if (allSameType && allSatisfy!(hasAssignableElements, R))
Expand All @@ -1009,7 +1009,7 @@ if (Ranges.length > 0 &&
source[i].front = v;
return;
}
assert(false);
assert(false, "Attempt to set `front` of empty `chain` range");
}
}

Expand All @@ -1022,7 +1022,7 @@ if (Ranges.length > 0 &&
if (source[i].empty) continue;
return source[i].moveFront();
}
assert(false);
assert(false, "Attempt to `moveFront` of empty `chain` range");
}
}

Expand All @@ -1035,7 +1035,7 @@ if (Ranges.length > 0 &&
if (source[i].empty) continue;
return fixRef(source[i].back);
}
assert(false);
assert(false, "Attempt to get `back` of empty `chain` range");
}

void popBack()
Expand All @@ -1046,7 +1046,7 @@ if (Ranges.length > 0 &&
source[i].popBack();
return;
}
assert(false);
assert(false, "Attempt to `popBack` of empty `chain` range");
}

static if (allSatisfy!(hasMobileElements, R))
Expand All @@ -1058,7 +1058,7 @@ if (Ranges.length > 0 &&
if (source[i].empty) continue;
return source[i].moveBack();
}
assert(false);
assert(false, "Attempt to `moveBack` of empty `chain` range");
}
}

Expand All @@ -1072,7 +1072,7 @@ if (Ranges.length > 0 &&
source[i].back = v;
return;
}
assert(false);
assert(false, "Attempt to set `back` of empty `chain` range");
}
}
}
Expand Down Expand Up @@ -1109,7 +1109,7 @@ if (Ranges.length > 0 &&
index -= length;
}
}
assert(false);
assert(false, "Attempt to access out-of-bounds index of `chain` range");
}

static if (allSatisfy!(hasMobileElements, R))
Expand All @@ -1129,7 +1129,7 @@ if (Ranges.length > 0 &&
index -= length;
}
}
assert(false);
assert(false, "Attempt to move out-of-bounds index of `chain` range");
}
}

Expand All @@ -1153,7 +1153,7 @@ if (Ranges.length > 0 &&
index -= length;
}
}
assert(false);
assert(false, "Attempt to write out-of-bounds index of `chain` range");
}
}

Expand Down

0 comments on commit 9bd2f2b

Please sign in to comment.