PPT Slide
A template function can simplify the creation of the adaptor, since the template argument types are inferred from the parameter values, and need not be specified when a template function is invoked.
template <class T> Fruit * newFruit (T & f) { return new FruitAdaptor<T>(f); }
Using the newFruit function the fruit types will be inferred from the function arguments, and need not be specified explicitly by the programmer: Fruit * fruitThree = newFruit (anApple); Fruit * fruitFour = newFruit (anOrange)