From 7d47cd39b62f10aa64b368b322aed19b58be3303 Mon Sep 17 00:00:00 2001 From: Rui Xia Date: Tue, 2 Apr 2019 10:46:37 -0700 Subject: [PATCH] Change bind2nd to bind (#747) `std::bind2nd` is deprecated in C++11 and removed in C++17 (see [MSDN documentation](https://docs.microsoft.com/en-us/cpp/standard-library/functional-functions?view=vs-2017#bind2nd)). Change to `std::bind` with placeholder instead. --- onnxruntime/test/providers/cpu/tensor/tensor_op_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/onnxruntime/test/providers/cpu/tensor/tensor_op_test.cc b/onnxruntime/test/providers/cpu/tensor/tensor_op_test.cc index e1ba1613c5..bf7fcf2e70 100644 --- a/onnxruntime/test/providers/cpu/tensor/tensor_op_test.cc +++ b/onnxruntime/test/providers/cpu/tensor/tensor_op_test.cc @@ -361,7 +361,7 @@ std::pair MeanStdev(std::vector& v) { std::vector diff(v.size()); std::transform(v.begin(), v.end(), diff.begin(), - std::bind2nd(std::minus(), mean)); + std::bind(std::minus(), std::placeholders::_1, mean)); float sq_sum = std::inner_product(diff.begin(), diff.end(), diff.begin(), 0.0f); float stdev = std::sqrt(sq_sum / v.size()); @@ -374,11 +374,11 @@ void Normalize(std::vector& v, float stdev = mean_stdev.second; std::transform(v.begin(), v.end(), v.begin(), - std::bind2nd(std::minus(), mean)); + std::bind(std::minus(), std::placeholders::_1, mean)); if (normalize_variance) { std::transform(v.begin(), v.end(), v.begin(), - std::bind2nd(std::divides(), stdev)); + std::bind(std::divides(), std::placeholders::_1, stdev)); } }