1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

build: eliminate calls of removed functionality from C++17

Most part is deprecated since C++11
This commit is contained in:
Alexander Alekhin
2018-02-06 19:05:34 +03:00
parent f77f2876ff
commit 44d7435a48
11 changed files with 63 additions and 12 deletions
+5 -2
View File
@@ -52,8 +52,11 @@
namespace cv
{
struct greaterThanPtr :
public std::binary_function<const float *, const float *, bool>
#ifdef CV_CXX11
struct greaterThanPtr
#else
struct greaterThanPtr : public std::binary_function<const float *, const float *, bool>
#endif
{
bool operator () (const float * a, const float * b) const
// Ensure a fully deterministic result of the sort
@@ -385,7 +385,11 @@ namespace
const double thetaScale = levels_ / 360.0;
r_table_.resize(levels_ + 1);
#ifdef CV_CXX11
std::for_each(r_table_.begin(), r_table_.end(), [](std::vector<Point>& e)->void { e.clear(); });
#else
std::for_each(r_table_.begin(), r_table_.end(), std::mem_fun_ref(&std::vector<Point>::clear));
#endif
for (int y = 0; y < templSize_.height; ++y)
{
@@ -692,8 +696,12 @@ namespace
getContourPoints(edges, dx, dy, points);
features.resize(levels_ + 1);
#ifdef CV_CXX11
std::for_each(features.begin(), features.end(), [=](std::vector<Feature>& e) { e.clear(); e.reserve(maxBufferSize_); });
#else
std::for_each(features.begin(), features.end(), std::mem_fun_ref(&std::vector<Feature>::clear));
std::for_each(features.begin(), features.end(), std::bind2nd(std::mem_fun_ref(&std::vector<Feature>::reserve), maxBufferSize_));
#endif
for (size_t i = 0; i < points.size(); ++i)
{