Replacement of shared_dynamic_cast by dynamic_pointer_cast

shared_dynamic_cast is deprecated in new versions of boost