Michele De Stefano's C++ Utilities
endian.hpp
Go to the documentation of this file.
1 // endian.hpp
2 //
3 // Copyright (c) 2009 - Michele De Stefano (micdestefano@users.sourceforge.net)
4 //
5 // Distributed under the MIT License (See accompanying file LICENSE)
6 
7 #ifndef MDS_UTILS_ENDIAN_HPP_INCLUDED
8 #define MDS_UTILS_ENDIAN_HPP_INCLUDED
9 
10 #include <boost/detail/endian.hpp>
11 #include <boost/mpl/bool.hpp>
12 
30 namespace mds_utils {
31 
60 #ifdef BOOST_LITTLE_ENDIAN
61 struct little_endian_machine : boost::mpl::true_ {};
62 struct big_endian_machine : boost::mpl::false_ {};
63 #else
64 struct little_endian_machine : boost::mpl::false_ {};
65 struct big_endian_machine : boost::mpl::true_ {};
66 #endif
67 
68 } // namespace mds_utils
69 
70 #endif
Determines if the machine uses big endian byte ordering.
Definition: endian.hpp:65
Main namespace of all Michele De Stefano&#39;s C++ utilities.
Definition: endian.hpp:30
Determines if the machine uses little endian byte ordering.
Definition: endian.hpp:64