Multiple ChoiceHard 45s
Object slicing by value parameter
Passing a `Derived` by value to a function taking `Base` by value causes:
Options
- 1A compile error, because polymorphic types with virtual functions cannot legally be passed by value.
- 2The full Derived object is copied into the parameter and polymorphism is preserved across the call.
- 3Object slicing: only the Base sub-object is copied, virtual dispatch uses Base's implementations.
- 4A reference wrapper is automatically created, so the function receives a std::reference_wrapper<Base>.
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.