No, the type must be declared at least before the pointer type can be used, and placing an anonymous namespace in the header will not work. But why do you want to do this? If you really want to hide the implementation class, make it a private inner class, i.e.
struct Foo {
Foo();
private:
struct FooImpl;
boost::scoped_ptr<FooImpl> pimpl;
};
struct Foo::FooImpl {
FooImpl();
};
Foo::Foo() : pimpl(new FooImpl) { }