[Boost-bugs] [Boost C++ Libraries] #11385: uuid serializes incorrectly if adjustfield left is set

Subject: [Boost-bugs] [Boost C++ Libraries] #11385: uuid serializes incorrectly if adjustfield left is set
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-06-09 14:34:22


#11385: uuid serializes incorrectly if adjustfield left is set
-------------------------------------------+-----------------------
 Reporter: NIck McKenna <nick.mckenna@…> | Owner: atompkins
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: uuid
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
-------------------------------------------+-----------------------
 If the stream being used has adjustfield left set, any bytes less
 than 16 seem to be serialized incorrectly. I think this is because
 the padding of the leading '0' is done to the wrong side.
 ie 0x08 becomes 0x80

 I'm using VS2013 on Windows 7.

 As an example:

 boost::uuids::uuid uuid = { 0x0a, 0xe0, 0x47, 0x50,
 0x0a, 0x0a,
 0xeb, 0xec,
 0xed, 0xee,
 0xfc, 0x08, 0x4d, 0xcf, 0xe7, 0xf5
 }; \\
 stringstream ss;\\
 ss << left << uuid;\\
 cout << ss.str() << endl;\\

 Outputs: a0e04750-a0a0-ebec-edee-fc804dcfe7f5\\
 instead of 0ae04750-0a0a-ebec-edee-fc084dcfe7f5

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11385>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC