
28 Jul
2006
28 Jul
'06
7:51 p.m.
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? terry #include <boost/numeric/interval.hpp> #include <iostream> typedef boost::numeric::interval<short> Interval; std::ostream& operator<<(std::ostream& os, const Interval& x) { return os << x.lower() << ".." << x.upper(); } int main() { Interval r1(-3, 7); std::cout << "r1=" << r1 << std::endl; Interval r2 = boost::numeric::abs(r1); std::cout << "r2=" << r2 << std::endl; return 0; } // main