File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2519,9 +2519,15 @@ ubyte codeLength(C)(dchar c) @safe pure nothrow @nogc
25192519 in a string whose character type is $(D C). This is particularly useful
25202520 when slicing one string with the length of another and the two string
25212521 types use different character types.
2522+
2523+ Params:
2524+ C = the character type to get the encoding length for
2525+ input = the input range to calculate the encoding length from
2526+ Returns:
2527+ The number of code units in `input` when encoded to `C`
25222528 +/
25232529size_t codeLength (C, InputRange)(InputRange input)
2524- if (isInputRange! InputRange && is (ElementType! InputRange : dchar ))
2530+ if (isInputRange! InputRange && ! isInfinite ! InputRange && is (ElementType! InputRange : dchar ))
25252531{
25262532 alias EncType = Unqual! (ElementEncodingType! InputRange);
25272533 static if (isSomeString! InputRange && is (EncType == C) && is (typeof (input.length)))
You can’t perform that action at this time.
0 commit comments