Re: const version for foreach/opApply

2012-06-11 Thread Matthias Walter
On 06/10/2012 12:30 AM, Era Scarecrow wrote: On Saturday, 9 June 2012 at 10:09:25 UTC, Matthias Walter wrote: First, thank you for your answer. I've already made some tiny modifications in order to make BitArray work for my purposes:

Re: const version for foreach/opApply

2012-06-09 Thread Matthias Walter
On 2012-06-08 22:47, Era Scarecrow wrote: On Friday, 8 June 2012 at 16:33:28 UTC, Matthias Walter wrote: Hi, trying to traverse the entries of a std.bitmanip.BitArray I stumbled upon the following problem: In case I want to accept const(BitArray) objects, it shall look like the following

Re: const version for foreach/opApply

2012-06-09 Thread Era Scarecrow
On Saturday, 9 June 2012 at 10:09:25 UTC, Matthias Walter wrote: First, thank you for your answer. I've already made some tiny modifications in order to make BitArray work for my purposes: https://github.com/xammy/phobos/commit/eb46d99217f2bf1e6d173964e2954248b08146d6 If you plan to create

const version for foreach/opApply

2012-06-08 Thread Matthias Walter
Hi, trying to traverse the entries of a std.bitmanip.BitArray I stumbled upon the following problem: The original code is as follows: int opApply(scope int delegate(ref bool) dg) { int result; for (size_t i = 0; i len; i++) { bool b = opIndex(i); result = dg(b); this[i] = b;

Re: const version for foreach/opApply

2012-06-08 Thread Era Scarecrow
On Friday, 8 June 2012 at 16:33:28 UTC, Matthias Walter wrote: Hi, trying to traverse the entries of a std.bitmanip.BitArray I stumbled upon the following problem: In case I want to accept const(BitArray) objects, it shall look like the following (maybe using ref const(bool) for the