diff options
Diffstat (limited to 'libphobos/src/std/utf.d')
-rw-r--r-- | libphobos/src/std/utf.d | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libphobos/src/std/utf.d b/libphobos/src/std/utf.d index a29025a..5c23684 100644 --- a/libphobos/src/std/utf.d +++ b/libphobos/src/std/utf.d @@ -65,9 +65,9 @@ module std.utf; import std.exception : basicExceptionCtors; import core.exception : UnicodeException; import std.meta : AliasSeq; -import std.range.primitives; -import std.traits : isAutodecodableString, isPointer, isSomeChar, - isSomeString, isStaticArray, Unqual, isConvertibleToString; +import std.range; +import std.traits : isAutodecodableString, isConvertibleToString, isPointer, + isSomeChar, isSomeString, isStaticArray, Unqual; import std.typecons : Flag, Yes, No; @@ -2809,7 +2809,7 @@ if (isSomeChar!C) The number of code units in `input` when encoded to `C` +/ size_t codeLength(C, InputRange)(InputRange input) -if (isInputRange!InputRange && !isInfinite!InputRange && isSomeChar!(ElementType!InputRange)) +if (isSomeFiniteCharInputRange!InputRange) { alias EncType = Unqual!(ElementEncodingType!InputRange); static if (isSomeString!InputRange && is(EncType == C) && is(typeof(input.length))) @@ -2961,7 +2961,7 @@ if (isSomeString!S) * For a lazy, non-allocating version of these functions, see $(LREF byUTF). */ string toUTF8(S)(S s) -if (isInputRange!S && !isInfinite!S && isSomeChar!(ElementEncodingType!S)) +if (isSomeFiniteCharInputRange!S) { return toUTFImpl!string(s); } @@ -3003,7 +3003,7 @@ if (isInputRange!S && !isInfinite!S && isSomeChar!(ElementEncodingType!S)) * For a lazy, non-allocating version of these functions, see $(LREF byUTF). */ wstring toUTF16(S)(S s) -if (isInputRange!S && !isInfinite!S && isSomeChar!(ElementEncodingType!S)) +if (isSomeFiniteCharInputRange!S) { return toUTFImpl!wstring(s); } @@ -3047,7 +3047,7 @@ if (isInputRange!S && !isInfinite!S && isSomeChar!(ElementEncodingType!S)) * For a lazy, non-allocating version of these functions, see $(LREF byUTF). */ dstring toUTF32(S)(scope S s) -if (isInputRange!S && !isInfinite!S && isSomeChar!(ElementEncodingType!S)) +if (isSomeFiniteCharInputRange!S) { return toUTFImpl!dstring(s); } |