> 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.

As an aside, is there an official reason to use int instead of bool?
I notice fltk prefers int.  is_ in the function name is clear enough,
but bool is still better documentation.  Oh, also why I suggested
as_group is because there's a common convention that is_ is for a
predicate, but that's not universal.

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to