On 05/03/2015 06:06 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Sunday, May 03, 2015 15:21:15 Andrew Godfrey via
Digitalmars-d-learn wrote:
I really don't think that it's an issue in general, but if you
do want to
guarantee that nothing affects the capacity of your array, then
On Monday, 4 May 2015 at 06:23:42 UTC, Ali Çehreli wrote:
On 05/03/2015 06:06 PM, Jonathan M Davis via
Digitalmars-d-learn wrote:
(I am eagerly waiting for your DConf talk to see how you make
sense of it all.)
Well, we'll see how much I'm able to cover about arrays. The
focus of the talk
On Sunday, May 03, 2015 15:21:15 Andrew Godfrey via Digitalmars-d-learn wrote:
I really don't think that it's an issue in general, but if you
do want to
guarantee that nothing affects the capacity of your array, then
you're going
to need to either wrap all access to it
I agree with
I really don't think that it's an issue in general, but if you
do want to
guarantee that nothing affects the capacity of your array, then
you're going
to need to either wrap all access to it
I agree with everything Jonathan said in both threads EXCEPT that
this is not an issue.
The
On Sunday, 3 May 2015 at 15:21:17 UTC, Andrew Godfrey wrote:
I really don't think that it's an issue in general, but if you
do want to
guarantee that nothing affects the capacity of your array,
then you're going
to need to either wrap all access to it
I agree with everything Jonathan said
On Saturday, May 02, 2015 01:21:14 Ali Çehreli via Digitalmars-d-learn wrote:
2) void foo(const(int[]) arr); // cannot affect anything
// (even capacity)
Actually, you can modify the capacity of arr quite easily. All you have to
do is slice it
This is related to a discussion[1] that I had started recently but I
will give an even shorter example here:
void main()
{
// Two slices to all element
auto a = [ 1, 2, 3, 4 ];
auto b = a;
// Initially, they both have capacity (strange! :) )
assert(a.capacity == 7);
On 05/02/2015 01:56 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
I really don't think that it's reasonable in the general case to
expect to
be able to guarantee that the capacity of a dynamic array won't change.
Yes, it is very different from other languages like C and C++ that
On Saturday, May 02, 2015 07:46:27 Ali Çehreli via Digitalmars-d-learn wrote:
On 05/02/2015 01:56 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
I really don't think that it's reasonable in the general case to
expect to
be able to guarantee that the capacity of a dynamic array won't