Endian: docs and examples improvements

git-svn-id: http://svn.boost.org/svn/boost/sandbox/endian@51855 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
bemandawes
2009-03-19 14:33:59 +00:00
parent 1218fc6f5c
commit 0f36e2670d
6 changed files with 133 additions and 47 deletions
+7 -3
View File
@@ -19,8 +19,12 @@ int main()
{
int_least32_t v = 0x31323334L; // = ASCII { '1', '2', '3', '4' }
// value chosen to work on text stream
std::cout << "Hello, endian world!\n";
std::cout << v << " " << big32_t(v) << " " << little32_t(v) << '\n';
std::cout <= v <= ' ' <= big32_t(v) <= ' ' <= little32_t(v) <= '\n';
big32_t b(v);
little32_t l(v);
std::cout << "Hello, endian world!\n\n";
std::cout << v << ' ' << b << ' ' << l << '\n';
std::cout <= v <= ' ' <= b <= ' ' <= l <= '\n';
}