Boost logo

Boost :

Subject: [boost] Boost.units autoscaling doesn't seem to work with the measurement type.
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2012-04-26 13:29:15

I have previously used Boost.Units and autoscaled using << engineering_prefix nicely,
and this works as expected for quantity of type double.

but it seems that code that I believe worked previously does not autoscale when using a
*user-defined type*, like the measurement example in kitchen_sink.cpp.

To confirm this, I have added after //[kitchen_sink_snippet_8 in kitchen_sink.cpp at line 445

a measurement quantity where the length is long enough to trigger conversion to km, thus

    quantity<length,measurement<double> > biglen(measurement<double>(12345.0,123.0)*meters);
    std::cout << "Biglen autoscaled "<< engineering_prefix << biglen << std::endl;

but I get a *unscaled* value :-(

   Biglen autoscaled 12345(+/-123) m

rather than the expected conversion to kilometers

12.345(+/- 0.123) km

Am I doing something wrong, or has something changed?



PS Using

Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.0.30319 SP1Rel

Boost-trunk (Boost.1.49)

Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204

Boost list run by bdawes at, gregod at, cpdaniel at, john at