//: generics/DogsAndRobots.cpp class Dog { public: void speak() {} void sit() {} void reproduce() {} }; class Robot { public: void speak() {} void sit() {} void oilChange() { }; template void perform(T anything) { anything.speak(); anything.sit(); } int main() { Dog d; Robot r; perform(d); perform(r); } ///:~