3 ms·
What do you mean by value semantics here?
by tel 13y ago
What do you mean by value semantics here?
- deleted 13y ago[deleted]
- detrino 13y agoC++ gives you the freedom to choose between composition and subtyping to suit your problem without having to worry about an extra indirection if you choose composition. For example, the base member of Composed is not a pointer as it might be in a language with reference semantics: struct Base { int i; }; struct Derived : Base { bool b; }; struct Composed { Base base; bool b; };