mirror of
https://github.com/dlang/phobos.git
synced 2025-04-26 13:10: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]);
|
||||
}
|
||||
@property size_t length() { return impl.length; }
|
||||
size_t opDollar() { return impl.length; }
|
||||
alias opDollar = length;
|
||||
}
|
||||
static assert(hasSlicing!UbyteRange);
|
||||
|
||||
|
|
|
@ -1785,10 +1785,7 @@ if (is(immutable T == immutable bool))
|
|||
{
|
||||
return _store.refCountedStore.isInitialized ? _store._length : 0;
|
||||
}
|
||||
size_t opDollar() const
|
||||
{
|
||||
return length;
|
||||
}
|
||||
alias opDollar = length;
|
||||
|
||||
/**
|
||||
* Returns: The maximum number of elements the array can store without
|
||||
|
|
|
@ -4198,7 +4198,7 @@ private:
|
|||
@property bool empty() { return array.length == 0; }
|
||||
@property C front() { return array[0]; }
|
||||
@property C back() { return array[$ - 1]; }
|
||||
@property size_t opDollar() { return length; }
|
||||
alias opDollar = length;
|
||||
C opIndex(size_t i) { return array[i]; }
|
||||
}
|
||||
void popFront() { array = array[1 .. $]; }
|
||||
|
|
|
@ -1473,7 +1473,7 @@ private struct SliceOverIndexed(T)
|
|||
|
||||
@property size_t length()const { return to-from;}
|
||||
|
||||
auto opDollar()const { return length; }
|
||||
alias opDollar = length;
|
||||
|
||||
@property bool empty()const { return from == to; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue