Skip to content

mp_units::quantity_point::quantity_point

Constructors

Synopses

Declared in <mp-units/framework/quantity_point.h>

Default-constructs a point whose origin has no bounds, as its representation type is.

[[nodiscard]] quantity_point()
  requires(!detail::any_ancestor_has_bounds(PO))
= default;

» more...

Default-constructs a point whose origin has bounds, own or inherited, at the origin itself.

[[nodiscard]] constexpr quantity_point()
  requires(detail::any_ancestor_has_bounds(PO) &&
           detail::origin_within_bounds<PO, quantity_type>());

» more...

Construct from QP

template<QuantityPoint QP>
  requires(!QuantityPointOf<QP, absolute_point_origin>) && requires(const QP& src) {
    { src.point_for(absolute_point_origin) } -> QuantityPointOf<absolute_point_origin>;
    quantity_type{src.point_for(absolute_point_origin) - point_origin};
  }
[[nodiscard]] constexpr explicit quantity_point(QP const& qp);

» more...

Construct from QP

template</* implementation-defined */ 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);

» more...

Construct from QP

template<QuantityPointOf<absolute_point_origin> QP>
  requires std::constructible_from<quantity_type,
                                   detail::delta_from_origin_t<point_origin, QP>>
[[nodiscard]] constexpr explicit(
  !std::convertible_to<
    typename detail::delta_from_origin_type<point_origin, QP>::own_spec_type,
    quantity_type>) quantity_point(QP const& qp);

» more...

Construct from FwdQ

template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>>
  requires std::constructible_from<quantity_type, FwdQ> &&
           (point_origin == default_point_origin(R)) &&
           (detail::bounds_exact_in<PO, quantity_type>())
[[nodiscard]] constexpr explicit quantity_point(FwdQ&& q);

» more...

Constructor

template<typename FwdQ, QuantityOf<quantity_spec> Q = std::remove_cvref_t<FwdQ>>
  requires std::constructible_from<quantity_type, FwdQ> &&
           (detail::bounds_exact_in<PO, quantity_type>())
[[nodiscard]] constexpr quantity_point(FwdQ&& q, decltype(PO));

» more...

Constructor

template<typename FwdQ,
         /* implementation-defined */ PO2, Quantity Q = std::remove_cvref_t<FwdQ>>
  requires PointOriginFor<PO2, Q::quantity_spec> &&
           std::constructible_from<quantity_type, FwdQ> &&
           detail::SameAbsolutePointOriginAs<PO2, PO> &&
           (detail::bounds_exact_in<PO2{}, quantity<Q::reference, typename Q::rep>>()) &&
           (detail::bounds_exact_in<PO, quantity_type>())
[[nodiscard]] constexpr quantity_point(FwdQ&& q, PO2);

» more...

Return Value

Note

The return value should not be discarded.