Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
.dup should be @Property
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Apr 12, 2014
1 parent 4ef7b07 commit 0ffe24f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/object.di
Expand Up @@ -632,7 +632,7 @@ version (unittest)
private extern (C) void[] _d_newarrayU(const TypeInfo ti, size_t length) pure nothrow;

/// Provide the .dup array property.
auto dup(T)(T[] a)
@property auto dup(T)(T[] a)
if (!is(const(T) : T))
{
import core.internal.traits : Unconst;
Expand All @@ -648,7 +648,7 @@ auto dup(T)(T[] a)

/// ditto
// const overload to support implicit conversion to immutable (unique result, see DIP29)
T[] dup(T)(const(T)[] a)
@property T[] dup(T)(const(T)[] a)
if (is(const(T) : T))
{
// wrap unsafe _dup in @trusted to preserve @safe postblit
Expand All @@ -659,7 +659,7 @@ T[] dup(T)(const(T)[] a)
}

/// Provide the .idup array property.
immutable(T)[] idup(T)(T[] a)
@property immutable(T)[] idup(T)(T[] a)
{
static assert(is(T : immutable(T)), "Cannot implicitly convert type "~T.stringof~
" to immutable in idup.");
Expand Down
6 changes: 3 additions & 3 deletions src/object_.d
Expand Up @@ -2757,7 +2757,7 @@ private extern (C) void[] _d_newarrayU(const TypeInfo ti, size_t length) pure no
public:

/// Provide the .dup array property.
auto dup(T)(T[] a)
@property auto dup(T)(T[] a)
if (!is(const(T) : T))
{
import core.internal.traits : Unconst;
Expand All @@ -2773,7 +2773,7 @@ auto dup(T)(T[] a)

/// ditto
// const overload to support implicit conversion to immutable (unique result, see DIP29)
T[] dup(T)(const(T)[] a)
@property T[] dup(T)(const(T)[] a)
if (is(const(T) : T))
{
// wrap unsafe _dup in @trusted to preserve @safe postblit
Expand All @@ -2784,7 +2784,7 @@ T[] dup(T)(const(T)[] a)
}

/// Provide the .idup array property.
immutable(T)[] idup(T)(T[] a)
@property immutable(T)[] idup(T)(T[] a)
{
static assert(is(T : immutable(T)), "Cannot implicitly convert type "~T.stringof~
" to immutable in idup.");
Expand Down

0 comments on commit 0ffe24f

Please sign in to comment.