Page 1 of 1

How to inherit an iterator from a base class

Posted: Thu Jun 01, 2006 5:06 pm
by eacheon
Hi,

from the neuron book draft chapter 13 page 13 I learnt that inherit can be emulated that way.

However, the template I am inheriting has an iterator, is it possible to inherit this iterator too, and how?

thanks a lot,

y

Re: How to inherit an iterator from a base class

Posted: Thu Jun 01, 2006 5:53 pm
by eacheon
eacheon wrote:Hi,

from the neuron book draft chapter 13 page 13 I learnt that inherit can be emulated that way.

However, the template I am inheriting has an iterator, is it possible to inherit this iterator too, and how?

thanks a lot,

y
I tried:

Code: Select all


iterator all() {
    base.all($&1, $&2) {
        iterator_statement
    }
}

base.all() is an iterator of the base class.

However, nrniv errored and said that "ITERATOR can only be used in a for statement".