When designing a class, what do you make a member function, x.f(), and what do you make a free function, f(x)? When extending an already existing class, do you provide extra functionality with inheritance, composition, or adding new free functions? Do friend functions really violate encapsulation?
This presentation will cover techniques that not only allow safe and efficient interfaces, but also simplify your code. We will combine ideas from generic programming and object-oriented programming to achieve these goals. This talk will start with the basics of good engineering principles and build up from these to explain how to write scalable software. By taking a thoughtful approach to what should be a member function and what should be a free function, you can reduce code duplication and code size, thereby reducing the surface area for bugs.Slides