From bfa7edd5dba3973eacc75ca82183b7dd58f787c2 Mon Sep 17 00:00:00 2001 From: Hans Dembinski Date: Sun, 29 Sep 2019 10:47:56 +0200 Subject: [PATCH] pass by value (#224) --- include/boost/histogram/axis/regular.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/boost/histogram/axis/regular.hpp b/include/boost/histogram/axis/regular.hpp index a7b9828e..3de35f78 100644 --- a/include/boost/histogram/axis/regular.hpp +++ b/include/boost/histogram/axis/regular.hpp @@ -146,8 +146,8 @@ struct step_type { Helper function to mark argument as step size. */ template -auto step(T&& t) { - return step_type{std::forward(t)}; +step_type step(T t) { + return step_type{t}; } /** @@ -248,8 +248,8 @@ public: * (start + n * step). */ template - regular(transform_type trans, const step_type& step, value_type start, - value_type stop, metadata_type meta = {}) + regular(transform_type trans, step_type step, value_type start, value_type stop, + metadata_type meta = {}) : regular(trans, static_cast(std::abs(stop - start) / step.value), start, start + static_cast(std::abs(stop - start) / step.value) * @@ -268,8 +268,7 @@ public: * (start + n * step). */ template - regular(const step_type& step, value_type start, value_type stop, - metadata_type meta = {}) + regular(step_type step, value_type start, value_type stop, metadata_type meta = {}) : regular({}, step, start, stop, std::move(meta)) {} /// Constructor used by algorithm::reduce to shrink and rebin (not for users).