<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 4, 2013 at 10:42 AM, Gabriel Dos Reis <span dir="ltr"><<a href="mailto:gdr@microsoft.com" target="_blank" class="cremed">gdr@microsoft.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">| -----Original Message-----<br>
| From: <a href="mailto:ub-bounces@open-std.org" class="cremed">ub-bounces@open-std.org</a> [mailto:<a href="mailto:ub-bounces@open-std.org" class="cremed">ub-bounces@open-std.org</a>] On Behalf Of<br>
| Lawrence Crowl<br>
| Sent: Monday, November 4, 2013 10:40 AM<br>
| To: WG21 UB study group<br>
| Subject: Re: [ub] bit_cast<br>
|<br>
| The intent is to provide an alternative to the idiom<br>
|<br>
| int i; float f = *(float*)&i;<br>
|<br>
| The usual objection is "but memcpy is slow".<br>
| The answer is "your compiler is better than you think".<br>
<br>
</div>If we give it enough latitude in terms of non-aliasing :-)</blockquote></div><br>The compiler needs no latitude to optimize using memcpy to do this.</div></div>