I\'m flip-flopping between naming conventions for typedef\'ing the boost::shared_ptr template. For example:
typedef boost::shared_ptr FooPtr;
I have used both the outer and encapsulated typedef, but ended up with the first,
typedef boost::shared_ptr FooPtr;
solely because in combined expressions this looks cleaner than Foo::Ptr.
Doesn't it bother you that Foo is now "aware" of how it will be passed around?
Often enough, these classes are creatable through a factory method only:
struct Foo
{
static FooPtr Create() { return FooPtr(new Foo); }
protected:
Foo() {}
}
That's kind of "stronger" than encapsulating the typedef, yet a very common pattern.