Michele De Stefano's C++ Utilities
test_endian.cpp
1 // test_endian.cpp
2 //
3 // Copyright (c) 2009 - Michele De Stefano (micdestefano@users.sourceforge.net)
4 //
5 // Distributed under the MIT License (See accompanying file LICENSE)
6 
14 #include <iostream>
15 #include <mds_utils/endian.hpp>
16 
17 using namespace std;
18 using namespace mds_utils;
19 
20 template<class IsEndian>
21 void print_endianity();
22 
23 template<>
24 void print_endianity<boost::mpl::true_>() {
25  cout << "\nLittle Endian machine !!!\n" << endl;
26 }
27 
28 
29 template<>
30 void print_endianity<boost::mpl::false_>() {
31  cout << "\nBig Endian machine !!!\n" << endl;
32 }
33 
34 
35 int main() {
36 
37  print_endianity<little_endian_machine::type>();
38 
39  return EXIT_SUCCESS;
40 }
Main namespace of all Michele De Stefano&#39;s C++ utilities.
Definition: endian.hpp:30
Contains classes to test machine endianity.