StackOverflow Questions for Tag: reinterpret-cast

Andy
Andy

Reputation: 3244

Should I use static_cast or reinterpret_cast when casting a void* to whatever

Score: 281

Views: 116008

Answers: 9

Read More
IAmPropper
IAmPropper

Reputation: 43

UB with reinterpret_cast

Score: 0

Views: 95

Answers: 0

Read More
X1ngChui
X1ngChui

Reputation: 91

How to reinterpret a value as bytes in a compile-time context in C++

Score: 2

Views: 119

Answers: 1

Read More
Alex O
Alex O

Reputation: 1819

reinterpret_cast to span of wrappers

Score: 4

Views: 104

Answers: 1

Read More
timmy george
timmy george

Reputation: 443

Is casting `the address of a pointer to a struct` to `the address of a struct whos first member is a pointer to the struct` UB?

Score: 4

Views: 71

Answers: 1

Read More
Mr.C64
Mr.C64

Reputation: 42914

Proper way of casting pointer types

Score: 72

Views: 122542

Answers: 3

Read More
Dan Weaver
Dan Weaver

Reputation: 51

Is reinterpret_cast from char* to uint32_t* undefined behaviour in CPP?

Score: 5

Views: 299

Answers: 2

Read More
Jemtaly
Jemtaly

Reputation: 151

Reinterpret cast in C - cannot take the address of an rvalue

Score: 3

Views: 200

Answers: 3

Read More
Timothy Liu
Timothy Liu

Reputation: 406

Is it ok to cast a temporary object to rvalue reference and then cast it to lvalue reference to discard lvalue reference parameters of a function?

Score: 1

Views: 82

Answers: 0

Read More
wimalopaan
wimalopaan

Reputation: 5462

Examples using reinterpret_cast that do not trigger UB

Score: 26

Views: 2896

Answers: 3

Read More
Peter Zajac
Peter Zajac

Reputation: 31

C++ pointer-interconvertibility/strict-aliasing rules between class objects with array members

Score: 3

Views: 99

Answers: 0

Read More
HeretoLearn
HeretoLearn

Reputation: 7434

When to use reinterpret_cast?

Score: 633

Views: 527408

Answers: 11

Read More
cao lei
cao lei

Reputation: 1011

Can reinterpret_cast be used to cast a pointer to an unimplemented class pointer"?

Score: 1

Views: 112

Answers: 2

Read More
Ashley Duncan
Ashley Duncan

Reputation: 1019

Reinterpret cast of void * didn't do what I thought it would

Score: 1

Views: 128

Answers: 1

Read More
Vlad the Impala
Vlad the Impala

Reputation: 15872

Why doesn't this reinterpret_cast compile?

Score: 84

Views: 61487

Answers: 11

Read More
PavelDev
PavelDev

Reputation: 661

How to convert a byte array to a type without UB?

Score: 0

Views: 127

Answers: 0

Read More
blonded04
blonded04

Reputation: 503

Why C++ allocators use reinterpret_cast and how to avoid it?

Score: 2

Views: 206

Answers: 2

Read More
haydenridd
haydenridd

Reputation: 23

Clarification on Undefined Behavior Surrounding reinterpret_cast<>

Score: 0

Views: 104

Answers: 1

Read More
Alexander S
Alexander S

Reputation: 119

When does reinterpret_cast violate the law?

Score: -2

Views: 179

Answers: 2

Read More
Shivanshu Arora
Shivanshu Arora

Reputation: 135

How is reinterpret_cast casting pointer to a different type without creating the object?

Score: 2

Views: 95

Answers: 1

Read More
PreviousPage 1Next