"Mike Wilson"
Thanks for that - I'll look into it.
----- Original Message ----- From: "Ryan Barrett"
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.
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. Of course, some platforms supply headers which will tell you about their endian-ness... -- Dave Abrahams Boost Consulting www.boost-consulting.com