Chapter 32. Name Lookup and the Interface Principle—Part 2

Difficulty: 9

What's in a class? That is, what is “part of” a class and its interface?

Hint #1: Clearly nonstatic member functions are tightly coupled to the class, and public nonstatic member functions make up part of the class's interface. What about static member functions? What about free functions?

Hint #2: Take some time to consider the implications of Item 31.

Solution

Solution

We'll start off with the deceptively simple question: What functions are part of a class, or make up the interface of a class?

The deeper questions are:

  • How does this answer fit with C-style object-oriented programming? ...

Get Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.