Boost logo

Boost :

From: Eric Lemings (lemings_at_[hidden])
Date: 2006-08-17 12:56:17


 

> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Andy Little
> Sent: Wednesday, August 16, 2006 7:46 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] Boost Units library preview
>
> Hi Eric,
>
...
>
> Tested in VC7.1 and VC8.0 of vthe two examples gave compile
> errors. Testing in gcc 4.0 gave a failed assertion at runtime

I assume you mean the measure_test. Try the following simple patch:

*** units-preview/libs/units/test/measure_test.cpp.orig Thu Aug 17
10:50:15 2006
--- units-preview/libs/units/test/measure_test.cpp Thu Aug 17
10:52:27 2006
***************
*** 38,52 ****
    feet f1 (1);
    assert (f1.value () == 1);
    f1 = 3;
! assert (f1.value () == 3);

    feet f2 (2);
    length_quantity q2 (f2);
    q2 = f1;
    feet f3 (q2);
! assert (f3.value () == 3);
    f2 = q2;
! assert (f2.value () == 3);

    // mixed units

--- 38,52 ----
    feet f1 (1);
    assert (f1.value () == 1);
    f1 = 3;
! assert (f1.value() > 2.999 && f1.value() < 3.001);

    feet f2 (2);
    length_quantity q2 (f2);
    q2 = f1;
    feet f3 (q2);
! assert (f1.value() > 2.999 && f1.value() < 3.001);
    f2 = q2;
! assert (f1.value() > 2.999 && f1.value() < 3.001);

    // mixed units

Eric.


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