Fabien Costantini wrote: >> Fabien Costantini wrote: >>> ... >>> Also, it really shocks me to see overloaded copy() methods in derived >>> classes of Fl_Image, a fast inspection shows that it only calls the >>> copy(w(),h()) virtual method. >>> So we should also _remove_ all overloaded copy() methods because they >>> duplicate the base class copy behavior. >> IIRC we can't do this since a virtual copy() that calls copy(w,h) >> will call the wrong copy(w,h) due to a side-effect of how C++ handles >> such things. > Here's a little demonstrator of what I am explaining: > ... > So any non virtual method calling a virtual method will call the right > derived class method (here B::copy(int, int)
The issue is not with modern compilers but with pre-ISO C++ compilers where the behavior was undefined. Unfortunately, those compilers are still around... -- ______________________________________________________________________ Michael Sweet, Easy Software Products mike at easysw dot com _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
