mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-11 05:07:58 +00:00
pass by value (#224)
This commit is contained in:
parent
62a13a4103
commit
bfa7edd5db
@ -146,8 +146,8 @@ struct step_type {
|
|||||||
Helper function to mark argument as step size.
|
Helper function to mark argument as step size.
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto step(T&& t) {
|
step_type<T> step(T t) {
|
||||||
return step_type<T&&>{std::forward<T>(t)};
|
return step_type<T>{t};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -248,8 +248,8 @@ public:
|
|||||||
* (start + n * step).
|
* (start + n * step).
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
regular(transform_type trans, const step_type<T>& step, value_type start,
|
regular(transform_type trans, step_type<T> step, value_type start, value_type stop,
|
||||||
value_type stop, metadata_type meta = {})
|
metadata_type meta = {})
|
||||||
: regular(trans, static_cast<index_type>(std::abs(stop - start) / step.value),
|
: regular(trans, static_cast<index_type>(std::abs(stop - start) / step.value),
|
||||||
start,
|
start,
|
||||||
start + static_cast<index_type>(std::abs(stop - start) / step.value) *
|
start + static_cast<index_type>(std::abs(stop - start) / step.value) *
|
||||||
@ -268,8 +268,7 @@ public:
|
|||||||
* (start + n * step).
|
* (start + n * step).
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
regular(const step_type<T>& step, value_type start, value_type stop,
|
regular(step_type<T> step, value_type start, value_type stop, metadata_type meta = {})
|
||||||
metadata_type meta = {})
|
|
||||||
: regular({}, step, start, stop, std::move(meta)) {}
|
: regular({}, step, start, stop, std::move(meta)) {}
|
||||||
|
|
||||||
/// Constructor used by algorithm::reduce to shrink and rebin (not for users).
|
/// Constructor used by algorithm::reduce to shrink and rebin (not for users).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user