![]() |
Boost : |
From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2006-08-02 03:26:23
Le vendredi 28 juillet 2006 à 14:51 -0500, Terry Golubiewski a écrit :
> The following code does not compile with g++ nor MSVC 2003
> because of ambiguity of first argument to std::max() in
> numeric::abs().
> Is a typecast needed in interval/utility.hpp?
Thanks for spotting this shortcoming. You are right, the first argument
to max indeed requires static_cast<T>(_). We didn't expect the library
to be used with a unary minus operator that looks like "not_T operator-
(T)". Unfortunately primitive types shorter than int do have this
property.
Best regards,
Guillaume
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk