Ticket #2390: float_comparison_unused.patch

File float_comparison_unused.patch, 1.8 KB (added by Bryan Silverthorn <bcs26@…>, 14 years ago)

patch against r49167

  • boost/test/floating_point_comparison.hpp

     
    200200    // Public typedefs
    201201    typedef bool result_type;
    202202
     203    check_is_close_t() { }
     204
    203205    template<typename FPT, typename ToleranceBaseType>
    204206    bool
    205207    operator()( FPT left, FPT right, percent_tolerance_t<ToleranceBaseType> tolerance,
    206                 floating_point_comparison_type fpc_type = FPC_STRONG )
     208                floating_point_comparison_type fpc_type = FPC_STRONG ) const
    207209    {
    208210        close_at_tolerance<FPT> pred( tolerance, fpc_type );
    209211
     
    212214    template<typename FPT, typename ToleranceBaseType>
    213215    bool
    214216    operator()( FPT left, FPT right, fraction_tolerance_t<ToleranceBaseType> tolerance,
    215                 floating_point_comparison_type fpc_type = FPC_STRONG )
     217                floating_point_comparison_type fpc_type = FPC_STRONG ) const
    216218    {
    217219        close_at_tolerance<FPT> pred( tolerance, fpc_type );
    218220
     
    221223};
    222224
    223225namespace {
    224 check_is_close_t check_is_close;
     226check_is_close_t const check_is_close;
    225227}
    226228
    227229//____________________________________________________________________________//
     
    234236    // Public typedefs
    235237    typedef bool result_type;
    236238
     239    check_is_small_t() { }
     240
    237241    template<typename FPT>
    238242    bool
    239     operator()( FPT fpv, FPT tolerance )
     243    operator()( FPT fpv, FPT tolerance ) const
    240244    {
    241245        return tt_detail::fpt_abs( fpv ) < tt_detail::fpt_abs( tolerance );
    242246    }
    243247};
    244248
    245249namespace {
    246 check_is_small_t check_is_small;
     250check_is_small_t const check_is_small;
    247251}
    248252
    249253//____________________________________________________________________________//