From f2248eca16965c7ff4336d596400efbd0097a870 Mon Sep 17 00:00:00 2001 From: RazvanN7 Date: Tue, 2 Apr 2019 11:49:22 +0300 Subject: [PATCH] Add explicit cast in stc/core/stdcpp/array.d --- src/core/stdcpp/array.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/stdcpp/array.d b/src/core/stdcpp/array.d index 75fa45a0bb..174215f5d1 100644 --- a/src/core/stdcpp/array.d +++ b/src/core/stdcpp/array.d @@ -97,7 +97,7 @@ pure nothrow @nogc: /// inout(T)* data() inout @safe { static if (N > 0) { return &_M_elems[0]; } else { return null; } } /// - ref inout(T[N]) as_array() inout @trusted { return data()[0 .. N]; } + ref inout(T)[N] as_array() inout @trusted { return cast(inout(T)[N])data()[0 .. N]; } /// ref inout(T) at(size_type i) inout @trusted { return data()[0 .. N][i]; } @@ -117,7 +117,7 @@ pure nothrow @nogc: /// inout(T)* data() inout @trusted { static if (N > 0) { return &__elems_[0]; } else { return cast(inout(T)*)__elems_.ptr; } } /// - ref inout(T)[N] as_array() inout @trusted { return data()[0 .. N]; } + ref inout(T)[N] as_array() inout @trusted { return cast(inout(T)[N])data()[0 .. N]; } /// ref inout(T) at(size_type i) inout @trusted { return data()[0 .. N][i]; }