On Friday, July 20, 2012 17:15:53 Ellery Newcomer wrote:
> On 07/19/2012 06:09 PM, Ellery Newcomer wrote:
> > On 07/19/2012 02:51 AM, Artur Skawina wrote:
> >> Range!Node opSlice() { return Range!Node(first); }
> >> Range!(const Node) opSlice() const { return Range!(const
> >>
> >> Node)(first); }
On 07/19/2012 06:09 PM, Ellery Newcomer wrote:
On 07/19/2012 02:51 AM, Artur Skawina wrote:
Range!Node opSlice() { return Range!Node(first); }
Range!(const Node) opSlice() const { return Range!(const
Node)(first); }
it looks like you could almost merge these two into one using
On 07/19/2012 06:18 PM, Ali Çehreli wrote:
Now the output is different:
non-const foo called on a
const foo called on b
Ali
cool beans, thanks.
On 07/19/2012 06:09 PM, Ellery Newcomer wrote:
On 07/19/2012 02:51 AM, Artur Skawina wrote:
Range!Node opSlice() { return Range!Node(first); }
Range!(const Node) opSlice() const { return Range!(const Node)(first); }
anyone mind cluing me in on why this is possible?
It is the same as in C++.
On 07/19/2012 06:16 PM, Ali Çehreli wrote:
On 07/19/2012 06:09 PM, Ellery Newcomer wrote:
On 07/19/2012 02:51 AM, Artur Skawina wrote:
Range!Node opSlice() { return Range!Node(first); }
Range!(const Node) opSlice() const { return Range!(const Node)(first); }
anyone mind cluing me in on why t
On 07/19/2012 02:51 AM, Artur Skawina wrote:
Range!Node opSlice() { return Range!Node(first); }
Range!(const Node) opSlice() const { return Range!(const Node)(first); }
anyone mind cluing me in on why this is possible?
On 07/19/2012 06:44 AM, Jonathan M Davis wrote:
> On Thursday, July 19, 2012 04:39:26 Francisco Soulignac wrote:
>> So, my question is how can I (correctly) traverse a const SList,
>> const DList, etc?
>
> Right now? I'm pretty sure that that's impossible. Hopefully that will
> change,
> but get
On 07/19/12 06:39, Francisco Soulignac wrote:
> it's been a while since this question, and I don't know how to solve
> it either. The following code passes all the test using the last
> version of dmd (2.059).
>
> import std.container, std.algorithm;
>
> //non const case
> void assertequal(T)(SL
On Thursday, July 19, 2012 04:39:26 Francisco Soulignac wrote:
> So, my question is how can I (correctly) traverse a const SList,
> const DList, etc?
Right now? I'm pretty sure that that's impossible. Hopefully that will change,
but getting const and ranges to work together can be rather difficul
Hi all,
it's been a while since this question, and I don't know how to solve
it either. The following code passes all the test using the last
version of dmd (2.059).
import std.container, std.algorithm;
//non const case
void assertequal(T)(SList!(T) l, int[] r) {
assert(equal(l[], r));
}
/
On Friday, June 15, 2012 09:14:45 Matthias Walter wrote:
> Hi,
>
> I have a const std.container object (e.g., a const(Array!int)) of which
> I'd like to have a range which can traverse that container having
> read-only access. This does not seem to be possible with opSlice(). Is
> there an alterna
Hi,
I have a const std.container object (e.g., a const(Array!int)) of which
I'd like to have a range which can traverse that container having
read-only access. This does not seem to be possible with opSlice(). Is
there an alternative?
Best regards,
Matthias
12 matches
Mail list logo