spawn_result dyn_spawn_class(message msg) {
  using handle = typename infer_handle_from_class<T>::type;
  using pointer = intrusive_ptr<T>;
  pointer ptr;
  auto factory = &make_counted<T, Ts...>;
  auto res = msg.apply(factory);
  if (!res || res->empty() || !res->template match_element<pointer>(0))
    return {};
  ptr = std::move(res->template get_as_mutable<pointer>(0));
  ptr->launch(nullptr, false, false);
  return {ptr->address(), handle::message_types()};
}