Slide 27
Slide 27 text
Value operation cost
• Struct copy is cheap only when the struct type is trivial
• Trivial Types (POD: Plain Old Data): No extra copy, move, destruction semantics
• Int, Bool, Double, …
• A struct type that consists of trivial types
• Many container types in stdlib (Array, Set, …) has fast-path for trivial types
• Optimized to be a memcpy