O'Reilly logo

Extended STL, Volume 1: Collections and Iterators by Matthew Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Duck and Goose, or the Whimsical Bases of Partial Structural Conformance

 

Sometimes it kind of bothers me that our brains are so good at optimizing themselves for the task at hand. They get really good at discarding knowledge that is no longer necessary.

 
 --Sean Kelly
 

It’s harder to read code than to write it.

 
 --Joel Spolsky

Conformance

Named Conformance

Classically (by which I mean before template generics), types were verified to have the appropriate requirements for an operation by having the same name as the types that the operation requires. This is known as Named Conformance. Although it seems blatantly obvious, the insight comes when we consider the effect of inheritance. As we all know from those $2,000-a-day courses on object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required