And as with other data structures, be careful with modifications when using range-based for. We had plenty of crash issue with nsTArray + range-based for when we started to use it.
-Olli On 10/2/19 1:15 PM, Simon Giesecke wrote:
Hi, I recently [1] added STL-style iterators and begin/cbegin/end/cend member functions to nsBaseHashtable. This means that it is now possible to use range-based for and STL algorithms operating on iterators with all of its subclasses, which include nsClassHashtable, nsDataHashtable, nsInterfaceHashtable, nsJSThingHashtable and nsRefPtrHashtable. I also added an overview on existing support for range-based for and STL-style iterators in Mozilla data structures on MDN at [2]. If you have any questions or issues, please let me know or NI me on Bugzilla. Best wishes Simon [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1575479 [2] https://developer.mozilla.org/en-US/docs/Mozilla/Using_CXX_in_Mozilla_code#Mozilla_data_structures_and_standard_C_ranges_and_iterators
_______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform