Re: [fltk.coredev] Consider using std::vector (C++98 / C++11)

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Consider using std::vector (C++98 / C++11) imm 03:24 Jul 19 top right image
 
On Thu, 15 Jul 2021, 19:38 Bill Spitzak wrote:
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!

--
Ian
From my Fairphone FP3
   

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/CAGFM6dZxcdyn8oG-U5rK8HyrM9jFnFAnWFL%3DFr2%3DZCd3sOv1%2BA%40mail.gmail.com.
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.