Interface Principle roughly states that a free non-member function is closely tied to a class, therefore, part of the class interface if
- it mentions the class type, for ex: it accepts the class in it’s parameter list
- It’s shipped along with the class, i.e., it is in the same namespace and the header file as the class definition
Keonig’s Lookup is closely related to this principle.
Source: Modern C++ Design
If you like topics such as this then please consider subscribing to my podcast. I talk to some of the stalwarts in tech and ask them what their favorite productivity hacks are:
Available on iTunes Podcast
Visit Void Star Podcast’s page on iTunes Podcast Portal. Please Click ‘Subscribe’, leave a comment.