Item 29. Virtual Constructors and Prototype

Suppose you find yourself in a Swedish restaurant, and you’d like to order a meal. Unfortunately, your knowledge of Swedish is limited to technical correspondence, cursing, or (typically) a combination of the two. The menu is in Swedish, and you can’t read Swedish, but you do notice a gentleman on the other side of the room who is really enjoying his meal. Therefore, you call over the waiter and say

If that gentleman is having fish, I’d like fish. If he’s having spaghetti, I’d like spaghetti too. Otherwise, if he’s having eel, then eel it is. However, if he has decided on the preserved kumquats, then I’ll have those.

Does this sound reasonable? Of course not. (For one thing, you probably don’t want ...

Get C++ Common Knowledge: Essential Intermediate Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.