C++ Logo

std-discussion

Advanced search

Re: Fixing common reinterpret_cast design patterns

From: Lyberta <lyberta_at_[hidden]>
Date: Sun, 21 Jul 2019 03:07:00 +0000
Brian Bi via Std-Discussion:
> What ideas did you have regarding how to fix it?

For my use cases I just create an object on the stack and memcpy bytes
into it. It works because copying bytes is explicitly allowed by strict
aliasing rules.

For more esoteric use cases there is P1631: https://wg21.link/p1631


Received on 2019-07-20 22:10:01