mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 11:54:27 +02:00
refactor: quantity_point
construction now relays only on a construction of a quantity_type
Relates to #221
This commit is contained in:
@@ -59,16 +59,9 @@ public:
|
|||||||
quantity_point(const quantity_point&) = default;
|
quantity_point(const quantity_point&) = default;
|
||||||
quantity_point(quantity_point&&) = default;
|
quantity_point(quantity_point&&) = default;
|
||||||
|
|
||||||
template<typename Value>
|
template<typename T>
|
||||||
requires std::same_as<dimension, dim_one> &&
|
requires std::constructible_from<quantity_type, T>
|
||||||
safe_convertible_to_<std::remove_cvref_t<Value>, rep> &&
|
constexpr explicit quantity_point(T&& t) : q_(std::forward<T>(t)) {}
|
||||||
std::constructible_from<quantity_type, Value>
|
|
||||||
constexpr explicit quantity_point(Value&& v) : q_(std::forward<Value>(v)) {}
|
|
||||||
|
|
||||||
template<typename Q>
|
|
||||||
requires (Quantity<std::remove_cvref_t<Q>> || QuantityLike<std::remove_cvref_t<Q>>) &&
|
|
||||||
std::constructible_from<quantity_type, Q>
|
|
||||||
constexpr explicit quantity_point(Q&& q) : q_(std::forward<Q>(q)) {}
|
|
||||||
|
|
||||||
template<QuantityPoint QP2>
|
template<QuantityPoint QP2>
|
||||||
requires std::convertible_to<typename QP2::quantity_type, quantity_type>
|
requires std::convertible_to<typename QP2::quantity_type, quantity_type>
|
||||||
|
Reference in New Issue
Block a user