How to inherit an iterator from a base class

The basics of how to develop, test, and use models.
Post Reply
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

How to inherit an iterator from a base class

Post 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
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Re: How to inherit an iterator from a base class

Post 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".
Post Reply