diff options
Diffstat (limited to 'Examples/python')
-rw-r--r-- | Examples/python/std_vector/example.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Examples/python/std_vector/example.h b/Examples/python/std_vector/example.h index 4f0dac70d..52e260d6d 100644 --- a/Examples/python/std_vector/example.h +++ b/Examples/python/std_vector/example.h @@ -17,9 +17,8 @@ std::vector<double> half(const std::vector<double>& v) { } void halve_in_place(std::vector<double>& v) { - // would you believe this is the same as the above? - std::transform(v.begin(),v.end(),v.begin(), - std::bind2nd(std::divides<double>(),2.0)); + for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it) + *it /= 2.0; } |