On Mon, Feb 08, 2010 at 04:10:00PM -0800, Evan Laforge wrote:
> > But I'm open for both, and if there wasn't FLTK 2 I would also
> > have proposed the pointer return value. Maybe we should do
> > what is best for the code (i.e. return the pointer) and don't
> > look at FLTK 2 at all. Or we could also do both...
> 
> I vote for doing the cast in the method.  FLTK 2 type code that uses
> the pointer in a boolean context won't notice that it's not an int.
> And this way there's one less thing to remember and do manually and
> maybe get wrong (granted it's not hard to remember that is_group means
> you cast to Fl_Group, but why have it if you can avoid it?).  Having
> both seems redundant.

IMHO, pointer return values do not need a cast at all anywhere, which I
find definitely a pro.

like:
Fl_Group * Fl_Widget::is_group() { return 0; }
Fl_Group * Fl_Group::is_group() { return this; }

Kurt

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to