Constructors
Synopses
Declared in <mp‐units/framework/quantity_point.h>
Default constructor. Leaves the underlying quantity default‐initialized.
[[nodiscard]]
quantity_point() = default;
Converting constructor from a quantity point anchored to a different absolute point origin.
template<QuantityPoint QP>
requires (!QuantityPointOf<QP, absolute_point_origin>) && requires(const QP& src) {
{ src.point_for(point_origin) } ‐> QuantityPointOf<point_origin>;
quantity_type{src.point_for(point_origin) ‐ point_origin};
}
[[nodiscard]]
constexpr
explicit
quantity_point(QP const& qp);
Constructs a quantity point from an external quantity‐point‐like type via quantity_point_like_traits.
template<QuantityPointLike QP>
requires (quantity_point_like_traits<QP>::point_origin == point_origin) &&
std::constructible_from<quantity_type, quantity<quantity_point_like_traits<QP>::reference,
typename quantity_point_like_traits<QP>::rep>>
[[nodiscard]]
constexpr
explicit(quantity_point_like_traits<QP>::explicit_import || !std::convertible_to<quantity<quantity_point_like_traits<QP>::reference, typename quantity_point_like_traits<QP>::rep>, quantity_type>)
quantity_point(QP const& qp);
Converting constructor from another quantity point that shares this one's absolute point origin.
template<QuantityPointOf<absolute_point_origin> QP>
requires std::constructible_from<quantity_type, typename QP::quantity_type>
[[nodiscard]]
constexpr
explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>)
quantity_point(QP const& qp);
Constructs a quantity point from a quantity, measured from the default point origin.
template<
typename FwdQ,
QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>>
requires std::constructible_from<quantity_type, FwdQ> && (point_origin == default_point_origin®)
[[nodiscard]]
constexpr
explicit
quantity_point(FwdQ&& q);
Constructs a quantity point from a quantity measured from this point's own origin.
template<
typename FwdQ,
QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>>
requires std::constructible_from<quantity_type, FwdQ>
[[nodiscard]]
constexpr
quantity_point(
FwdQ&& q,
decltype(PO) po);
Constructs a quantity point from a quantity measured from another point origin that shares this one's absolute point origin.
template<
typename FwdQ,
PointOrigin PO2,
Quantity Q = std::remove_cvref_t<FwdQ>>
requires PointOriginFor<PO2, Q::quantity_spec> && std::constructible_from<quantity_type, FwdQ> &&
detail::SameAbsolutePointOriginAs<PO2, PO>
[[nodiscard]]
constexpr
quantity_point(
FwdQ&& q,
PO2 po);
Return Value
|
Note
|
The return value should not be discarded. |
Parameters
Name |
Description |
qp |
the source quantity point to convert from |
q |
the quantity giving the offset from |
po |
the point origin the quantity is measured from, equal to |
Created with MrDocs