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

Commit

Permalink
Use short name as the deduced types
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jul 17, 2015
1 parent d8c7cec commit 73a6555
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/object.d
Original file line number Diff line number Diff line change
Expand Up @@ -1823,49 +1823,49 @@ V[K] dup(T : V[K], K, V)(T* aa)
return (*aa).dup;
}

auto byKey(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc
auto byKey(T : V[K], K, V)(T aa) pure nothrow @nogc
{
static struct Result
{
AARange r;

pure nothrow @nogc:
@property bool empty() { return _aaRangeEmpty(r); }
@property ref Key front() { return *cast(Key*)_aaRangeFrontKey(r); }
@property ref K front() { return *cast(K*)_aaRangeFrontKey(r); }
void popFront() { _aaRangePopFront(r); }
@property Result save() { return this; }
}

return Result(_aaRange(cast(void*)aa));
}

auto byKey(T : Value[Key], Value, Key)(T *aa) pure nothrow @nogc
auto byKey(T : V[K], K, V)(T* aa) pure nothrow @nogc
{
return (*aa).byKey();
}

auto byValue(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc
auto byValue(T : V[K], K, V)(T aa) pure nothrow @nogc
{
static struct Result
{
AARange r;

pure nothrow @nogc:
@property bool empty() { return _aaRangeEmpty(r); }
@property ref Value front() { return *cast(Value*)_aaRangeFrontValue(r); }
@property ref V front() { return *cast(V*)_aaRangeFrontValue(r); }
void popFront() { _aaRangePopFront(r); }
@property Result save() { return this; }
}

return Result(_aaRange(cast(void*)aa));
}

auto byValue(T : Value[Key], Value, Key)(T *aa) pure nothrow @nogc
auto byValue(T : V[K], K, V)(T* aa) pure nothrow @nogc
{
return (*aa).byValue();
}

auto byKeyValue(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc
auto byKeyValue(T : V[K], K, V)(T aa) pure nothrow @nogc
{
static struct Result
{
Expand All @@ -1879,14 +1879,14 @@ auto byKeyValue(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc
{
// We save the pointers here so that the Pair we return
// won't mutate when Result.popFront is called afterwards.
private Key* keyp;
private Value* valp;
private K* keyp;
private V* valp;

@property ref inout(Key) key() inout { return *keyp; }
@property ref inout(Value) value() inout { return *valp; }
@property ref inout(K) key() inout { return *keyp; }
@property ref inout(V) value() inout { return *valp; }
}
return Pair(cast(Key*)_aaRangeFrontKey(r),
cast(Value*)_aaRangeFrontValue(r));
return Pair(cast(K*)_aaRangeFrontKey(r),
cast(V*)_aaRangeFrontValue(r));
}
void popFront() { _aaRangePopFront(r); }
@property Result save() { return this; }
Expand All @@ -1895,7 +1895,7 @@ auto byKeyValue(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc
return Result(_aaRange(cast(void*)aa));
}

auto byKeyValue(T : Value[Key], Value, Key)(T* aa) pure nothrow @nogc
auto byKeyValue(T : V[K], K, V)(T* aa) pure nothrow @nogc
{
return (*aa).byKeyValue();
}
Expand Down

0 comments on commit 73a6555

Please sign in to comment.