> 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. Yes this would be true indeed if copy() was virtual but only copy(w,h) is, for quickly being convinced see:
http://www.fltk.org/doc-1.3/classFl__Image.html#cef2b3eff2aaa48ae174d246703446e0 (I recognize I get a tremendous satisfaction to advertize the new documentation here :-) .. and notice this not a virtual method. I also checked that _all_ copy() methods just do copy(w,h). So I'd vote for removing it because it's useless at least as for today IMHO. > > I think the best we could do is have a virtual copy() method for > each of the base classes (Fl_Image, Fl_Bitmap, Fl_Pixmap, and > Fl_RGB_Image) that calls its own copy(w,h) implementation, and those > implementations cannot be inlined. > > Moreover, it is conceivable that a copy() method could do something > different/faster than copy(w,h). If it does (like a shallow copy instead of a deep copy) it could be nice to change the name of the method. > > -- > ______________________________________________________________________ > Michael Sweet, Easy Software Products mike at easysw dot com Fabien _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
