To make it clear:
Base* base = new Base();
static_cast<Derived*>(base) ===> OK
static_cast<Derived&>(*base) ===> OK
boost::polymorphic_downcast<Derived*>(base) ===> OK
boost::polymorphic_downcast<Derived&>(*base) ===> IMPOSSIBLE
boost::polymorphic_downcast being a kind of "debug-safe version" of
static_cast, it should provide the same capabilities.
This patch extend boost::polymorphic_downcast to support references just
like static_cast does.
This is achieved by introducing a partial specialization for references.
Unit tests have been updated accordingly.