- 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 and ranges
- 13. Lambdas, closures, and function objects
- 14. Object identity
- 15. Out parameters
❱
- 15.1. Multiple return values
- 15.2. Optional return values
- 15.3. Pre-allocated buffers
- 16. Rust and C++ interoperability (FFI)
- 17. NRVO and RVO
- 18. Placement new
19. Concurrency (threads and async)
- Patterns
- 20. Adapter pattern
- 21. Visitor pattern and double dispatch
- 22. Curiously recurring template pattern (CRTP)
- 23. Pointer-to-implementation (PIMPL)
- Ecosystem
- 24. Libraries
- 25. Tests
- 26. Documentation (e.g., Doxygen)
- 27. Build systems (e.g., CMake)
- 28. Attribution notices