- C++ to Rust Phrasebook
- Idioms
- 1. Constructors
❱
- 1.1. Default constructors
- 1.2. Copy and move constructors
- 1.3. Rule of three/five/zero
- 2. Destructors and resource cleanup
- 3. Data modeling
❱
- 3.1. Abstract classes, interfaces, and dynamic dispatch
- 3.2. Concepts, interfaces, and static dispatch
- 3.3. Enums
- 3.4. Tagged unions and std::variant
- 3.5. Inheritance and implementation reuse
- 3.6. Template classes, functions, and methods
- 3.7. Template specialization
- 4. Null (nullptr)
❱
- 4.1. Sentinel values
- 4.2. Moved members
- 4.3. Zero-length arrays
- 5. Encapsulation
❱
- 5.1. Header files
- 5.2. Anonymous namespaces and static
- 5.3. Private members and friends
- 5.4. Private constructors
- 5.5. Setter and getter methods
- 6. Exceptions and error handling
❱
- 6.1. Expected errors
- 6.2. Errors indicating bugs
- 7. Type equivalents
- 8. Type promotions and conversions
- 9. User-defined conversions
- 10. Overloading
- 11. RTTI and dynamic_cast
12. Iterators
13. Function objects, lambdas, and closures
- 14. Object identity
- 15. Out parameters
❱
- 15.1. Multiple return values
- 15.2. Optional return values
- 15.3. Pre-allocated buffers
16. Varargs
17. Attributes
18. Calling C (FFI)
19. NRVO, RVO, and placement new
20. Concurrency (threads and async)
- Patterns
21. Adapter pattern
22. Visitor pattern and double dispatch
- 23. Curiously recurring template pattern (CRTP)
24. Pointer-to-implementation (PImpl)
25. X macros
- Ecosystem
- 26. Libraries
27. Unit tests
28. Documentation (Doxygen)
29. Build systems (CMake)
- 30. Attribution notices