Boost logo

Boost Users :

From: Mike Wilson (mike_at_[hidden])
Date: 2003-04-24 14:49:46


----- Original Message -----
From: "David Abrahams" <dave_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
Sent: Wednesday, April 23, 2003 2:48 AM
Subject: Re: Test for endian using MPL or PP(Wave?)

> "Mike Wilson" <mike_at_[hidden]> writes:
>
> > Thanks for that - I'll look into it.
> >
> > ----- Original Message -----
> > From: "Ryan Barrett" <rbarrett_at_[hidden]>
> > Newsgroups: gmane.comp.lib.boost.user
> > Sent: Monday, April 21, 2003 10:48 PM
> > Subject: Re: Test for endian using MPL or PP(Wave?)
> >
> >
> >> check out boost's template metaprogramming library...i won't guarantee
> >> anything, but you might be able to contort it to do what you need.
> >>
> >> http://boost.org/libs/mpl/doc/index.html
>
> Don't bother. Endian-ness is fundamentally a property of memory
> layout. You can't discover anything about the layout of bits in
> memory at compile-time (and certainly not using the preprocessor),
> since you can't dereference a pointer at compile-time. The only way
> to discover endian-ness is to write an integer type to memory and read
> it back out as a sequence of chars.
I thought so, but the doc was informative.

>
> Of course, some platforms supply headers which will tell you about
> their endian-ness...
I think I saw a BOOST_BIG_ENDIAN_TARGET mentioned in the archives, but no
such luck in my 1.29 sources.

Thanks.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net