C++ Reference
This page is a grab bag of useful links to C++ documentation in the Mozilla source docs or in the source code itself.
This will grow and gain organisation, so please add any links you find useful!
Miscellaneous
Using C++ in Mozilla code - general C++ coding guidelines.
XPIDL - details for XPCOM IDL files (e.g. how the types map between IDL, C++, Rust and JS).
{fmt} in Gecko - An implementation of C++20’s
std::formatformatting API, with some extra Mozilla goodies.GTests - Unit tests for C++.
Data structures
String Guide -
nsStringvsnsCStringvsnsACStringet al.C++ and Mozilla standard libraries - Guidelines for using standard C++ containers and libraries.
nsTArray - Analogous to
std::vector.HashMap and HashSet, both built on top of HashTable (examples in GTest). Probably prefer these to
nsTHashMap/nsTHashSet, which use a lot more virtual calls and less templating/inlining.