C++ Logo


Advanced search

Subject: Re: Fixing common reinterpret_cast design patterns
From: Lyberta (lyberta_at_[hidden])
Date: 2019-07-20 22:07:00

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

STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups