On Monday, 24 July 2017 at 15:41:33 UTC, Steven Schveighoffer wrote:

Because types with inheritance generally don't work right if you pass by value (i.e. the slicing problem).

structs don't support inheritance or virtual functions, so they can be safely passed by value.

But in C++, we pass them by reference also to avoid copies (const &).
The potential polymorphic usage is not the only point to consider.

Reply via email to