On Mon, Nov 4, 2013 at 10:42 AM, Gabriel Dos Reis <gdr@microsoft.com> wrote:
| -----Original Message-----
| From: ub-bounces@open-std.org [mailto:ub-bounces@open-std.org] On Behalf Of
| Lawrence Crowl
| Sent: Monday, November 4, 2013 10:40 AM
| To: WG21 UB study group
| Subject: Re: [ub] bit_cast
|
| The intent is to provide an alternative to the idiom
|
| int i; float f = *(float*)&i;
|
| The usual objection is "but memcpy is slow".
| The answer is "your compiler is better than you think".

If we give it enough latitude in terms of non-aliasing :-)

The compiler needs no latitude to optimize using memcpy to do this.