StackOverflow Questions for Tag: reinterpret-cast

Andy
Andy

Reputation: 3274

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

Score: 284

Views: 116898

Answers: 9

Read More
cbhattac
cbhattac

Reputation: 273

Is my understanding about undefined behavior in the following code using reinterpret_cast correct?

Score: -1

Views: 86

Answers: 0

Read More
IAmPropper
IAmPropper

Reputation: 43

UB with reinterpret_cast

Score: 0

Views: 100

Answers: 0

Read More
X1ngChui
X1ngChui

Reputation: 95

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: 1876

reinterpret_cast to span of wrappers

Score: 4

Views: 110

Answers: 1

Read More
timmy george
timmy george

Reputation: 447

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: 43004

Proper way of casting pointer types

Score: 73

Views: 123396

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: 315

Answers: 2

Read More
Jemtaly
Jemtaly

Reputation: 151

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

Score: 3

Views: 203

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: 5472

Examples using reinterpret_cast that do not trigger UB

Score: 26

Views: 2950

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: 7454

When to use reinterpret_cast?

Score: 635

Views: 530562

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: 116

Answers: 2

Read More
Ashley Duncan
Ashley Duncan

Reputation: 1029

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: 15882

Why doesn't this reinterpret_cast compile?

Score: 85

Views: 61740

Answers: 11

Read More
PavelDev
PavelDev

Reputation: 683

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

Score: 0

Views: 143

Answers: 0

Read More
blonded04
blonded04

Reputation: 503

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

Score: 2

Views: 215

Answers: 2

Read More
haydenridd
haydenridd

Reputation: 23

Clarification on Undefined Behavior Surrounding reinterpret_cast<>

Score: 0

Views: 106

Answers: 1

Read More
Alexander S
Alexander S

Reputation: 119

When does reinterpret_cast violate the law?

Score: -2

Views: 181

Answers: 2

Read More
PreviousPage 1Next