On 05/16/2017 01:20 PM, Tim Song wrote:
On Tue, May 16, 2017 at 2:50 PM, Martin Sebor <mse...@gmail.com> wrote:
I'm not sure I understand why the ovl_iterator assignment needs
to be provided but if it does, not also defining one on the derived
class will call the base and return a reference to the base, making
the result no longer suitable where the derived is needed. This
is true for any other base members that return [a reference to]
the base type.
Huh? The implicitly declared copy assignment operator in a derived
class will always hide the assignment operators from the base class.
Ah, yes, you're right about the copy assignment. Thanks for
setting me straight! Clearly my C++ has become so rusty from
working on a C++ compiler that I forgot this essential bit
(making Nathan's C++-ification of GCC source code that much
more important! ;) The general point is still valid that
the other base members that return a reference to the base
type will have the slicing effect above.
Martin