Skip to content

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Oct 6, 2018

Stack:
    :black_circle:  #12408 Make dynamic_cast_if_rtti safer  💛

Using static_cast is better than reinterpret_cast because it will cause a compile time error in the following cases, while reinterpret_cast would run into undefined behavior and likely segfault:

  • Src and Dst are not related through inheritance (say converting int* to double*)
  • Src and Dst are related through virtual inheritance

Differential Revision: D10227820

Differential Revision: D10227820
Differential Version: 59900147
@soumith soumith deleted the export-D10227820 branch February 21, 2019 12:11
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants