Function ecl::is_big_endian

Function Documentation

inline bool ecl::is_big_endian()

Determines if your platform is big endian (at compile time).

This is a nice function that I found on stack overflow - the best thing about it, is that a good compiler will see that its a const function and thus store it in your program as a constant as well as excluding any code that fails this test (within the usual if/else condition check). Thus, effectively giving it the same power as a macro. Brilliant!

Returns:

bool : true if big endian, false otherwise.