From af6dc0e0356d44a60a9b70557261d392ba97072b Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Tue, 26 Mar 2019 18:49:52 -0400 Subject: [PATCH] Adding fix for copy warning on clang 7 / macOS 10.14.4 --- include/pybind11/numpy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 37471d8be9..ca954f59f2 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -1509,7 +1509,7 @@ struct vectorize_helper { if (trivial == broadcast_trivial::f_trivial) result = array_t(shape); else result = array_t(shape); - if (size == 0) return result; + if (size == 0) return std::move(result); /* Call the function */ if (trivial == broadcast_trivial::non_trivial) @@ -1517,7 +1517,7 @@ struct vectorize_helper { else apply_trivial(buffers, params, result.mutable_data(), size, i_seq, vi_seq, bi_seq); - return result; + return std::move(result); } template