I have a class hierarchy as follows:
class BaseSession : public boost::enable_shared_from_this
class DerivedSessionA : public BaseSession
Unless you want to transfer ownership of your std::unique_ptr, your function should take pointer or reference to T.
So signature of Func should be something like Func(DerivedSessionA*)
and then your call may look like:
std::unique_ptr ptr; // Initialize it with correct value
Func(dynamic_cast(ptr.get()));
Or as you seems to call it directly from a method in BaseSession:
Func(dynamic_cast(this));