mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 06:00:35 +03:00
Fix a few places where opDollar could be an alias of length
This commit is contained in:
parent
25348d61dd
commit
fe1deb2f84
4 changed files with 4 additions and 7 deletions
|
@ -3858,7 +3858,7 @@ if (canSwapEndianness!T && isInputRange!R && is(ElementType!R : const ubyte))
|
||||||
return UbyteRange(impl[start .. end]);
|
return UbyteRange(impl[start .. end]);
|
||||||
}
|
}
|
||||||
@property size_t length() { return impl.length; }
|
@property size_t length() { return impl.length; }
|
||||||
size_t opDollar() { return impl.length; }
|
alias opDollar = length;
|
||||||
}
|
}
|
||||||
static assert(hasSlicing!UbyteRange);
|
static assert(hasSlicing!UbyteRange);
|
||||||
|
|
||||||
|
|
|
@ -1785,10 +1785,7 @@ if (is(immutable T == immutable bool))
|
||||||
{
|
{
|
||||||
return _store.refCountedStore.isInitialized ? _store._length : 0;
|
return _store.refCountedStore.isInitialized ? _store._length : 0;
|
||||||
}
|
}
|
||||||
size_t opDollar() const
|
alias opDollar = length;
|
||||||
{
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns: The maximum number of elements the array can store without
|
* Returns: The maximum number of elements the array can store without
|
||||||
|
|
|
@ -4198,7 +4198,7 @@ private:
|
||||||
@property bool empty() { return array.length == 0; }
|
@property bool empty() { return array.length == 0; }
|
||||||
@property C front() { return array[0]; }
|
@property C front() { return array[0]; }
|
||||||
@property C back() { return array[$ - 1]; }
|
@property C back() { return array[$ - 1]; }
|
||||||
@property size_t opDollar() { return length; }
|
alias opDollar = length;
|
||||||
C opIndex(size_t i) { return array[i]; }
|
C opIndex(size_t i) { return array[i]; }
|
||||||
}
|
}
|
||||||
void popFront() { array = array[1 .. $]; }
|
void popFront() { array = array[1 .. $]; }
|
||||||
|
|
|
@ -1473,7 +1473,7 @@ private struct SliceOverIndexed(T)
|
||||||
|
|
||||||
@property size_t length()const { return to-from;}
|
@property size_t length()const { return to-from;}
|
||||||
|
|
||||||
auto opDollar()const { return length; }
|
alias opDollar = length;
|
||||||
|
|
||||||
@property bool empty()const { return from == to; }
|
@property bool empty()const { return from == to; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue