Back when fltk was created using std:: stuff was certainly much worse performance and storage wise compared to directly writing pointer manipulation like in C. However that has certainly changed over time, modern implementations especially on Linux are highly optimized. I suspect using std::vector<FlWidget*> everywhere possible would not cause any problems or incompatibility, the old widgets did hide the implementation pretty well.
Meant to reply to this ages ago... But forgot...
I got caught out by this a while back (might have been list rather than vector, but anyway...) where I'd updated a block of embedded code. In testing (on Windows) this went really well.
But the embedded version wouldn't even compile.
The key was that the gcc std lib *required* exception support, whereas the MS implementation did not. Our embedded targets don't support exceptions (not enough RAM and nowhere to propagate to anyway.) So that was the end of that!
The implementation may be "better" now of course but that's what happened back then.
The other key is not to expose the template in the API, as I've hit weird issues with that, where I think the compiler implemented the API differently between two modules due to... Something? Optimization settings? Don't know; compiled OK but choked in weird ways at runtime!
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.