Boost logo

Boost :

From: Terry Golubiewski (tjgolubi_at_[hidden])
Date: 2006-07-28 15:51:49


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


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