Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add low-overhead FixedAppender (internal for now) #10584

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions std/algorithm/comparison.d
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,12 @@ Returns:
*/
T1 clamp(T1, T2, T3)(T1 val, T2 lower, T3 upper)
{
static assert(is(T2 : T1), "T2 of type '", T2.stringof
, "' must be implicitly convertible to type of T1 '"
, T1.stringof, "'");
static assert(is(T3 : T1), "T3 of type '", T3.stringof
, "' must be implicitly convertible to type of T1 '"
, T1.stringof, "'");
static assert(is(T2 : T1), "T2 of type '" ~ T2.stringof
~ "' must be implicitly convertible to type of T1 '"
~ T1.stringof ~ "'");
static assert(is(T3 : T1), "T3 of type '" ~ T3.stringof
~ "' must be implicitly convertible to type of T1 '"
~ T1.stringof ~ "'");

assert(!lower.greaterThan(upper), "Lower can't be greater than upper.");

Expand Down
49 changes: 27 additions & 22 deletions std/algorithm/iteration.d
Original file line number Diff line number Diff line change
Expand Up @@ -2973,22 +2973,27 @@ front to back, even if it is a bidirectional range too.
*/
auto joiner(RoR, Separator)(RoR r, Separator sep)
{
static assert(isInputRange!RoR, "The type of RoR '", RoR.stringof
, " must be an InputRange (isInputRange!", RoR.stringof, ").");
static assert(isInputRange!(ElementType!RoR), "The ElementyType of RoR '"
, ElementType!(RoR).stringof, "' must be an InputRange "
, "(isInputRange!(ElementType!(", RoR.stringof , "))).");
static assert(isForwardRange!Separator, "The type of the Separator '"
, Separator.stringof, "' must be a ForwardRange (isForwardRange!("
, Separator.stringof, ")).");
static assert(is(ElementType!Separator : ElementType!(ElementType!RoR))
, "The type of the elements of the separator range does not match "
, "the type of the elements that are joined. Separator type '"
, ElementType!(Separator).stringof, "' is not implicitly"
, "convertible to range element type '"
, ElementType!(ElementType!RoR).stringof, "' (is(ElementType!"
, Separator.stringof, " : ElementType!(ElementType!", RoR.stringof
, "))).");
static assert(isInputRange!RoR,
"The type of RoR '" ~ RoR.stringof ~
"' must be an InputRange (isInputRange!" ~ RoR.stringof ~ ").");

static assert(isInputRange!(ElementType!RoR),
"The ElementType of RoR '" ~ ElementType!(RoR).stringof ~
"' must be an InputRange (isInputRange!(ElementType!(" ~ RoR.stringof ~ "))).");

static assert(isForwardRange!Separator,
"The type of the Separator '" ~ Separator.stringof ~
"' must be a ForwardRange (isForwardRange!(" ~ Separator.stringof ~ ")).");

static assert(is(ElementType!Separator : ElementType!(ElementType!RoR)),
"The type of the elements of the separator range does not match " ~
"the type of the elements that are joined. Separator type '" ~
ElementType!(Separator).stringof ~
"' is not implicitly convertible to range element type '" ~
ElementType!(ElementType!RoR).stringof ~
"' (is(ElementType!" ~ Separator.stringof ~
" : ElementType!(ElementType!" ~ RoR.stringof ~ ")))).");


static struct Result
{
Expand Down Expand Up @@ -7959,21 +7964,21 @@ $(REF nextPermutation, std,algorithm,sorting).
*/
Permutations!Range permutations(Range)(Range r)
{
static assert(isRandomAccessRange!Range, Range.stringof,
" must be a RandomAccessRange");
static assert(isRandomAccessRange!Range, Range.stringof
~ " must be a RandomAccessRange");
static assert(hasLength!Range, Range.stringof
, " must have a length");
~ " must have a length");

return typeof(return)(r);
}

/// ditto
struct Permutations(Range)
{
static assert(isRandomAccessRange!Range, Range.stringof,
" must be a RandomAccessRange");
static assert(isRandomAccessRange!Range, Range.stringof
~ " must be a RandomAccessRange");
static assert(hasLength!Range, Range.stringof
, " must have a length");
~ " must have a length");

private size_t[] _indices, _state;
private Range _r;
Expand Down
Loading
Loading