Chnaged a dcast to pdcast.
Fixed constexprness of pcast and pdcast of shared_ptrs.