nomicon icon indicating copy to clipboard operation
nomicon copied to clipboard

canonical example introducing subtyping

Open johan-boule opened this issue 5 years ago • 0 comments

The example trying to show a problem copying a dog's data into an animal's slot is not convincing me of any problem: only the animal part of the dog is going to be copied and that's presumably compatible with a cat's data. It's called slicing in C++. AFAICT a direct transcription of the code to C++ would work fine.

johan-boule avatar Jul 15 '20 00:07 johan-boule