I tried replacing the package global $a with $c in the faint hope that making the iterator a true lexical would help. That band-aid didn't change matters.
By your description I'm sure you know this, but Camel 3ed, "The Copy Constructor (=)", pp357-358, describes this exact problem. The solution is, as you mention, to write operator = as a deep clone, duplicating the referred object. Your concern about copying database handles is well-founded, that could lead to terrible trouble.
I think a redesign is in order. You could lighten the iterator by moving its data and low level implementation into the partner class. Or you could lighten tha partner class by constructing it of references to handles, the "Another Layer of Indirection" approach.
Good Luck!
After Compline,
Zaxo
In reply to Re: Post-increments, overloaded mutators, and reference counts
by Zaxo
in thread Post-increments, overloaded mutators, and reference counts
by khkramer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |