[bt-devel] backend
Martin Gruner
bt-devel@crosswire.org
Sat, 28 Oct 2000 17:25:39 +0200
On Saturday 28 October 2000 18:39, you wrote:
> > That is true. IMO the function should only modify this key where it is
> > called, and give back a pointer to _this_. No new key created, only moved
> > this one to the next entry.
>
> Hm, but if we say something like this:
> CSwordVerseKey *key1 = new CSwordVerseKey(m_module);
> CSwordVerseKey *key2 = new CSwordVerseKey(m_module);
> .....
> key1 = key2->getNextVerse();
OK, true. We could then use
CSwordVerseKey CSwordVerseKey::NextVerse()
[example like above]
but it might be even better to use
void CSwordVerseKey::getNextVerse()
and then like this
CSwordVerseKey *key1 = new CSwordVerseKey(m_module);
CSwordVerseKey *key2 = new CSwordVerseKey(m_module);
...
key2 = key1;
key2->getNextVerse();
1 line longer, but much more safe and simple.
Martin