diff --git a/std/array.d b/std/array.d index 8df1ecc67..4584dcc92 100644 --- a/std/array.d +++ b/std/array.d @@ -170,7 +170,7 @@ if (isIterable!Range && !isAutodecodableString!Range && !isInfinite!Range) /// ditto ForeachType!(typeof((*Range).init))[] array(Range)(Range r) -if (is(Range : U*, U) && isIterable!U && !isAutodecodableString!Range && !isInfinite!Range) +if (is(Range == U*, U) && isIterable!U && !isAutodecodableString!Range && !isInfinite!Range) { return array(*r); } diff --git a/std/exception.d b/std/exception.d index c3cf74d9f..6ffc0f775 100644 --- a/std/exception.d +++ b/std/exception.d @@ -1069,9 +1069,9 @@ as the language is free to assume objects don't have internal pointers */ bool doesPointTo(S, T, Tdummy=void)(auto ref const S source, ref const T target) @nogc @trusted pure nothrow if (__traits(isRef, source) || isDynamicArray!S || - is(S : U*, U) || is(S == class)) + is(S == U*, U) || is(S == class)) { - static if (is(S : U*, U) || is(S == class) || is(S == interface)) + static if (is(S == U*, U) || is(S == class) || is(S == interface)) { const m = *cast(void**) &source; const b = cast(void*) ⌖ @@ -1115,9 +1115,9 @@ bool doesPointTo(S, T)(auto ref const shared S source, ref const shared T target /// ditto bool mayPointTo(S, T, Tdummy=void)(auto ref const S source, ref const T target) @trusted pure nothrow if (__traits(isRef, source) || isDynamicArray!S || - is(S : U*, U) || is(S == class)) + is(S == U*, U) || is(S == class)) { - static if (is(S : U*, U) || is(S == class) || is(S == interface)) + static if (is(S == U*, U) || is(S == class) || is(S == interface)) { const m = *cast(void**) &source; const b = cast(void*) ⌖ @@ -1533,21 +1533,6 @@ version (StdUnittest) assert( doesPointTo(cast(int*) s, i)); assert(!doesPointTo(cast(int*) s, j)); } -@safe unittest //more alias this opCast -{ - void* p; - struct A - { - void* opCast(T)() if (is(T == void*)) - { - return p; - } - alias foo = opCast!(void*); - alias foo this; - } - assert(!doesPointTo(A.init, p)); - assert(!mayPointTo(A.init, p)); -} /+ Returns true if the field at index `i` in ($D T) shares its address with another field. diff --git a/std/getopt.d b/std/getopt.d index c85247f92..42aeb4099 100644 --- a/std/getopt.d +++ b/std/getopt.d @@ -558,7 +558,7 @@ private template optionValidator(A...) import std.format : format; enum fmt = "getopt validator: %s (at position %d)"; - enum isReceiver(T) = is(T : U*, U) || (is(T == function)) || (is(T == delegate)); + enum isReceiver(T) = is(T == U*, U) || (is(T == function)) || (is(T == delegate)); enum isOptionStr(T) = isSomeString!T || isSomeChar!T; auto validator() diff --git a/std/traits.d b/std/traits.d index 37fcbc002..7c0109d9e 100644 --- a/std/traits.d +++ b/std/traits.d @@ -889,7 +889,7 @@ private template fqnType(T, ); } } - else static if (is(T : U*, U)) + else static if (is(T == U*, U)) { enum fqnType = chain!( fqnType!(U, qualifiers) ~ "*" @@ -3925,7 +3925,7 @@ template hasStaticMember(T, string member) { static if (__traits(hasMember, T, member)) { - static if (is(T : V*, V)) + static if (is(T == V*, V)) alias U = V; else alias U = T; diff --git a/std/utf.d b/std/utf.d index 7a0556de8..3eef5cbcc 100644 --- a/std/utf.d +++ b/std/utf.d @@ -3136,7 +3136,7 @@ private T toUTFImpl(T, S)(scope S s) collection cycle and cause a nasty bug when the C code tries to use it. +/ template toUTFz(P) -if (is(P : C*, C) && isSomeChar!C) +if (is(P == C*, C) && isSomeChar!C) { P toUTFz(S)(S str) @safe pure if (isSomeString!S)