Public inheritance is generally meant to be used to implement polymorphic behavior. It models "is-a" or "works-like-a". In other words, you have code that works on a base class pointer or reference, and virtual functions allow derived classes to specialize the work done by the functions that are called.

Private inheritance is used for "has-a" or "is-implemented-in-terms-of". It is a way of implementing a class in terms of another class. Composition is another way of doing this which is usually preferred, but there are a few cases in which private inheritance makes more sense. Composition just means making a member variable out of the other class:
Code:
template<typename T>
class myshared_ptr
{
    shared_ptr<T> p;
public:
    myshared_ptr() : p(new T) { }

    // add forwarding functions here.
};
See this FAQ for more information: http://www.parashift.com/c++-faq-lit...ce.html#faq-24