2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-28 05:22:24 +00:00

call abs() unqualified

[SVN r11031]
This commit is contained in:
Jeremy Siek
2001-09-05 15:04:39 +00:00
parent be7fdbbc90
commit 37cfe92cd1
2 changed files with 7 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ namespace boost {
for (tie(e, end) = out_edges(i, g); e != end; ++e) {
int f_i = get(index, i);
int f_j = get(index, target(*e, g));
using namespace std;
using namespace std; // to call abs() unqualified
b = std::max(b, size_type(abs(f_i - f_j)));
}
return b;
@@ -61,7 +61,8 @@ namespace boost {
for (tie(i, end) = edges(g); i != end; ++i) {
diff_t f_u = get(index_map, source(*i, g));
diff_t f_v = get(index_map, target(*i, g));
sum += std::abs(f_u - f_v);
using namespace std; // to call abs() unqualified
sum += abs(f_u - f_v);
}
return sum;
}

View File

@@ -48,8 +48,10 @@ namespace boost {
struct closed_plus
{
T operator()(const T& a, const T& b) const {
T inf = std::numeric_limits<T>::max();
if (b > 0 && std::abs(inf - a) < b)
using namespace std;
T inf = numeric_limits<T>::max();
// make sure to call abs() unqualified.
if (b > 0 && abs(inf - a) < b)
return inf;
return a + b;
}