mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-09 23:04:07 +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.
|
||||
*/
|
||||
template <typename T>
|
||||
auto step(T&& t) {
|
||||
return step_type<T&&>{std::forward<T>(t)};
|
||||
step_type<T> step(T t) {
|
||||
return step_type<T>{t};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -248,8 +248,8 @@ public:
|
||||
* (start + n * step).
|
||||
*/
|
||||
template <class T>
|
||||
regular(transform_type trans, const step_type<T>& step, value_type start,
|
||||
value_type stop, metadata_type meta = {})
|
||||
regular(transform_type trans, step_type<T> step, value_type start, value_type stop,
|
||||
metadata_type meta = {})
|
||||
: regular(trans, static_cast<index_type>(std::abs(stop - start) / step.value),
|
||||
start,
|
||||
start + static_cast<index_type>(std::abs(stop - start) / step.value) *
|
||||
@ -268,8 +268,7 @@ public:
|
||||
* (start + n * step).
|
||||
*/
|
||||
template <class T>
|
||||
regular(const step_type<T>& step, value_type start, value_type stop,
|
||||
metadata_type meta = {})
|
||||
regular(step_type<T> 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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user