On 4/10/18 6:07 PM, Cym13 wrote:
On Tuesday, 10 April 2018 at 20:08:14 UTC, Jonathan M Davis wrote:
On Tuesday, April 10, 2018 19:47:10 Nordlöw via Digitalmars-d-learn
wrote:
On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote:
> On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wro
On Tue, Apr 10, 2018 at 10:07:40PM +, Cym13 via Digitalmars-d-learn wrote:
[...]
> On the other hand I don't think the end user should have to scratch
> his head to find the length of a range, especially if it's not trivial
> to get (say, O(log n) kind of case). Therefore exposing a method in
>
On Tuesday, April 10, 2018 22:07:40 Cym13 via Digitalmars-d-learn wrote:
> On Tuesday, 10 April 2018 at 20:08:14 UTC, Jonathan M Davis wrote:
> > On Tuesday, April 10, 2018 19:47:10 Nordlöw via
> >
> > Digitalmars-d-learn wrote:
> >> On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote:
>
On Tuesday, 10 April 2018 at 20:08:14 UTC, Jonathan M Davis wrote:
On Tuesday, April 10, 2018 19:47:10 Nordlöw via
Digitalmars-d-learn wrote:
On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote:
> On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote:
>> Should ranges always provid
On Tuesday, 10 April 2018 at 20:16:18 UTC, Steven Schveighoffer
wrote:
e.g. std.array.array is going to pre-allocate an array of the
correct length and fill it in, vs. appending each element as it
gets them from the range.
Personally, I would store the length because typically a
container ran
On 4/10/18 4:08 PM, Jonathan M Davis wrote:
On Tuesday, April 10, 2018 19:47:10 Nordlöw via Digitalmars-d-learn wrote:
I'm thinking of my own container Hashmap having its range
ByKeyValue requiring one extra word of memory to store the
iteration count which, in turn, can be used to calculate the
On Tuesday, April 10, 2018 19:47:10 Nordlöw via Digitalmars-d-learn wrote:
> On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote:
> > On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote:
> >> Should ranges always provide a length property?
> >
> > No.
> >
> >> If so, in which cases
On Tuesday, 10 April 2018 at 14:34:40 UTC, Adam D. Ruppe wrote:
On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote:
Should ranges always provide a length property?
No.
If so, in which cases is a length property an advantage or a
requirement?
Just provide it whenever it is cheap to do
On Tuesday, April 10, 2018 14:25:52 Nordlöw via Digitalmars-d-learn wrote:
> Should ranges always provide a length property?
>
> If so, in which cases is a length property an advantage or a
> requirement?
Whether a range has a length property or not is primarily dependent on how
efficient it is to
On Tuesday, 10 April 2018 at 14:25:52 UTC, Nordlöw wrote:
Should ranges always provide a length property?
No.
If so, in which cases is a length property an advantage or a
requirement?
Just provide it whenever it is cheap to do so. If you need to do
complex calculations or especially loop o
Should ranges always provide a length property?
If so, in which cases is a length property an advantage or a
requirement?
11 matches
Mail list logo