mp_units::quantity_point::is_within_bounds¶
Tells whether converting qp with quantity_point{qp} would pass the bounds of the point's origin.
Synopsis¶
Declared in <mp-units/framework/quantity_point.h>
template<typename QP>
requires(QuantityPoint<QP> || detail::QuantityPointLike<QP>) &&
(!std::same_as<QP, quantity_point>) &&
std::constructible_from<quantity_point, const QP&> &&
(detail::bounds_exact_in<PO, quantity_type>()) &&
(detail::enforced_bounds_check<PO, quantity_type>()) &&
(!QuantityPoint<QP> || QuantityPointOf<QP, absolute_point_origin> ||
detail::projection_checks_no_bounds<QP, absolute_point_origin>())
[[nodiscard]] constexpr static bool is_within_bounds(QP const& qp);
Description¶
The value tested is the one the selected converting constructor stores: qp measured from point_origin, for a point from the same absolute origin, projected with frame_projection for a point from another absolute origin, or imported for a point-like type. It is then tested as by the overload taking a quantity and an origin.
Offered under the same conditions as that overload. For a point from another absolute origin, it also requires that no checking policy applies to the point that the projection returns, nor to the point that it is given unless qp is measured from its absolute origin. A checking policy there would report a rejected value as a precondition violation or through a handler, instead of returning false. It doesn't cover anything the projection does itself.
Return Value¶
Note
The return value should not be discarded.