From 6c0588164a242e4f538e4d0cfd72dd0f5a469c43 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 29 May 2017 11:41:49 +0200 Subject: [PATCH] Rename String.toString back to get() Since it is expected that the return type of toString() is immutable(char)[] and not char[] or const(char)[]. --- source/tanya/container/array.d | 2 +- source/tanya/container/set.d | 3 +++ source/tanya/container/string.d | 7 +------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/source/tanya/container/array.d b/source/tanya/container/array.d index 9a2fdd5..472b376 100644 --- a/source/tanya/container/array.d +++ b/source/tanya/container/array.d @@ -160,7 +160,7 @@ struct Range(E) return typeof(return)(*this.container, this.begin + i, this.begin + j); } - inout(E[]) get() inout @trusted + inout(E)[] get() inout @trusted { return this.begin[0 .. length]; } diff --git a/source/tanya/container/set.d b/source/tanya/container/set.d index fc18992..f26e679 100644 --- a/source/tanya/container/set.d +++ b/source/tanya/container/set.d @@ -27,6 +27,9 @@ import tanya.memory; */ struct Range(E) { + private alias ContainerType = CopyConstness!(E, Array!(Bucket!(Unqual!E))); + private ContainerType* container; + @disable this(); @property Range save() diff --git a/source/tanya/container/string.d b/source/tanya/container/string.d index 564a84c..7e50458 100644 --- a/source/tanya/container/string.d +++ b/source/tanya/container/string.d @@ -199,12 +199,7 @@ struct ByCodeUnit(E) return typeof(return)(*this.container, this.begin + i, this.begin + j); } - const(E)[] toString() const @trusted - { - return this.begin[0 .. length]; - } - - E[] toString() @trusted + inout(E)[] get() inout @trusted { return this.begin[0 .. length]; }