Boost logo

Boost :

From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2006-08-03 12:15:51


Le jeudi 03 août 2006 à 17:49 +0200, Johan Råde a écrit :

> All I need to do is to get my hands on the bit patterns of 1.0f, -1.0f
> and x. Do I really have to copy the memory to do that?
> That seems like overkill.

You don't have to copy the memory, you can simply read the bit patterns
char by char, if you prefer. Any other kind of access will produce wrong
assembly code on compilers with "strong" optimizers.

> Can't I just form pointers to the float constants, cast the pointers to
> int pointers, and dereference them?

No you can't. See paragraph 3.10/15 of the C++ standard.

Best regards,

Guillaume


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk