Recommendations
Compiler warnings
- -Wexit-time-destructors (Clang)
- -Wglobal-constructors (Clang)
- -Wpessimizing-move
- -Wrange-loop-construct
Clang-tidy checks
- performance-unnecessary-value-param
- performance-unnecessary-copy-initialization
- performance-for-range-copy
- modernize-pass-by-value
- performance-inefficient-vector-operation
- performance-noexcept-move-constructor
- modernize-use-emplace
Key points
- In-place construction without copies or moves
- Pass non-trivial objects by reference
- Use view types ( std::string_view , std::span )
- Use in-place constructors for STL types
- Use emplace
- Use transparent comparators for std::string in associative containers
- Move data to compile time
- Use clang-tidy checks and warnings