summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-06-17 15:18:21 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-06-17 15:18:21 +0200
commit2ed3f8a7b6c4000f52546b0b4b4378a74edf517f (patch)
tree4f6d1e76953021af1a57724e623b08b1ed30d8f4
parent1163f512e637f20677a0da8c9448523f3a08318c (diff)
binsearch_closest: Use C++ style castingHEADmaster
-rw-r--r--binsearch_closest/binsearch_closest.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/binsearch_closest/binsearch_closest.hpp b/binsearch_closest/binsearch_closest.hpp
index 3db703f..b8a7004 100644
--- a/binsearch_closest/binsearch_closest.hpp
+++ b/binsearch_closest/binsearch_closest.hpp
@@ -58,7 +58,7 @@ ssize_t binsearch_closest(const std::vector<T> vec, T val)
if (imax - imin == 1 && std::abs(vec.at(imax) - val) < std::abs(vec.at(imin) - val))
imin = imax;
- return (ssize_t)imin;
+ return static_cast<ssize_t>(imin);
}
#endif /* __BINSEARCH_CLOSEST_HPP__ */