On 9/23/2011 6:52 PM, Mehrdad wrote:

To illustrate, I run into problem almost every other time I use D, and to me
it's *only* a problem because source is const:

class MyRange : InputRange!char
{
char peeked;
InputRange!char source;
char front() const

char front()  // fixed!

{
// How do I lazy-load the value?
if (peeked == '\0')
{
peeked = source.front;
// ERROR, popFront isn't const...
source.popFront();
}
return peeked;
}
}

Reply via email to