On 12/10/2013 11:28 AM, Chris Pearce wrote:
Hi All,
Can we start using C++ STL containers like std::set, std::map, std::queue in
Mozilla code please? Many of the STL containers are more convenient to
use than our equivalents, and more familiar to new contributors.
I understand that we used to have a policy of not using STL in mozilla code
since some older compilers we wanted to support didn't have very good
support, but I'd assume that that argument no longer holds since already build
and ship a bunch of third party code that uses std containers (angle,
webrtc, chromium IPC, crashreporter), and the sky hasn't fallen.
I'm not proposing a mass rewrite converting nsTArray to std::vector, just that
we allow STL in new code.
Are there valid reasons why should we not allow C++ STL containers in Mozilla
code?
Cheers,
Chris P.
std::map/set may not have the performance characteristics people think. They
are significantly slower than
xpcom hashtables (since they are usually trees), yet people tend to use them as
HashTables or HashSets.
Someone should compare the performance of std::unordered_map to our hashtables.
(Problem is that the comparison needs to be done on all the platforms).
-Olli
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform