refactor: use perfect forwarding for make functions
Addresses https://github.com/mpusz/units/pull/261#discussion_r597131272.
This commit is contained in:
1 parent
c61b8643d7
commit
234337d310
2 files changed
+6
-6
No files matched your search
@@ -34,9 +34,9 @@ namespace units {
|
||||
namespace detail {
|
||||
|
||||
template<Kind K>
|
||||
inline constexpr auto make_quantity_kind_fn = [](auto q) {
|
||||
using Q = decltype(q);
|
||||
return quantity_kind<K, typename Q::unit, typename Q::rep>(std::move(q));
|
||||
inline constexpr auto make_quantity_kind_fn = [](auto&& q) {
|
||||
using Q = std::remove_reference_t<decltype(q)>;
|
||||
return quantity_kind<K, typename Q::unit, typename Q::rep>(std::forward<decltype(q)>(q));
|
||||
};
|
||||
|
||||
template<QuantityKind QK>
|
||||
|
||||
Reference in new issue
Block a user