Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2002-11-14 10:31:24


I continue to make progress with format, but seem to fail most tests the
format a hex value.

In particular, if I want to format an 8 digit hex number to display as:

0x00001234

I am currently getting

00000x1234

I beleive this is some test code that does roughly something similar to
the library implementation:

int main()
{
    std::cout.setf( std::ios::showbase );
    std::cout << "BCB hex test: "
               << std::setfill( '0' )
               << std::setw( 8 )
               << std::internal
               << std::hex
               << 0x1234 << std::endl;
}

Is this a correct simplification on the library algorithm for this test
case? I'm not sure about relying on 'internal' to separate 0x from 1234
before padding. Is this the technique format uses? And if so, is it
correct? Or am I missing something else in the library?

[I'm no streams expert, and will happily file a bug report with borland
if someone can quote me a relevent section of the standard, if that is
indeed the case]

-- 
AlisdairM

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk