Is it bad practice to alter dynamic arrays that have references to them?

2010-08-05 Thread simendsjo
Just tell me if this is frowned upon... The reason I posted on SO is because I think it can help making people aware of D. http://stackoverflow.com/questions/3416657/is-it-bad-practice-to-alter-dynamic-arrays-that-have-references-to-them Let me know if it's not accepted to crosspost like this.

Re: Is it bad practice to alter dynamic arrays that have references to them?

2010-08-05 Thread Steven Schveighoffer
On Thu, 05 Aug 2010 13:10:44 -0400, simendsjo simen.end...@pandavre.com wrote: Just tell me if this is frowned upon... The reason I posted on SO is because I think it can help making people aware of D.

Re: Is it bad practice to alter dynamic arrays that have references to them?

2010-08-05 Thread simendsjo
On 05.08.2010 19:35, Steven Schveighoffer wrote: On Thu, 05 Aug 2010 13:10:44 -0400, simendsjo simen.end...@pandavre.com wrote: (...) One helpful function to note is the capacity function: http://digitalmars.com/d/2.0/phobos/object.html#capacity This gives you the capacity of the array, or

Re: Is it bad practice to alter dynamic arrays that have references to them?

2010-08-05 Thread Steven Schveighoffer
On Thu, 05 Aug 2010 14:41:12 -0400, simendsjo simen.end...@pandavre.com wrote: On 05.08.2010 19:35, Steven Schveighoffer wrote: On Thu, 05 Aug 2010 13:10:44 -0400, simendsjo simen.end...@pandavre.com wrote: (...) One helpful function to note is the capacity function:

Re: Is it bad practice to alter dynamic arrays that have references to them?

2010-08-05 Thread simendsjo
On 05.08.2010 20:50, Steven Schveighoffer wrote: On Thu, 05 Aug 2010 14:41:12 -0400, simendsjo simen.end...@pandavre.com wrote: On 05.08.2010 19:35, Steven Schveighoffer wrote: On Thu, 05 Aug 2010 13:10:44 -0400, simendsjo simen.end...@pandavre.com wrote: (...) (...) Ah, that's really

Re: Is it bad practice to alter dynamic arrays that have references to them?

2010-08-05 Thread Steven Schveighoffer
On Thu, 05 Aug 2010 15:23:13 -0400, simendsjo simen.end...@pandavre.com wrote: On 05.08.2010 20:50, Steven Schveighoffer wrote: On Thu, 05 Aug 2010 14:41:12 -0400, simendsjo simen.end...@pandavre.com wrote: On 05.08.2010 19:35, Steven Schveighoffer wrote: On Thu, 05 Aug 2010 13:10:44