Possible duplicate:
Is there a way to make a C ++ style compile time statement to determine the limb of a machine?
I am looking for a Boost :: type_traits template meta program that will return whether the compiler is large or small. Something like is_big_endian<T> . How to write this?
Using this method is to create a library that automatically adapts to the environment, by implementing a specific specialized specialization based on the final information. For instance,
template<> void copy_big_endian_impl<true>(T *dst, const T *src, size_t sz) {
This would allow passing is_big_endian as a template argument.
source share