Skip to content

mp_units::utility::metrologically_compatible

Checks whether two measured quantities, or two measured points, agree within their uncertainties

Synopsis

Declared in <mp-units/utility/uncertain.h>

template<typename Lhs, typename Rhs>
  requires((mp_units::Quantity<Lhs> && mp_units::Quantity<Rhs>) ||
           (mp_units::QuantityPoint<Lhs> && mp_units::QuantityPoint<Rhs>)) &&
          detail::MeasuredOrExact<Lhs, uncertain> &&
          detail::MeasuredOrExact<Rhs, uncertain> &&
          requires(const Lhs& lhs, const Rhs& rhs) { lhs - rhs; }
[[nodiscard]] constexpr bool metrologically_compatible(Lhs const& lhs, Rhs const& rhs,
                                                       value_type coverage_factor);

Note

This function is a hidden friend of uncertain, declared only inside that class: it can be found only through argument-dependent lookup.

Description

The quantity form of metrologically_compatible. Both operands are converted to their common unit by lhs - rhs, including the uncertainty of a conversion factor built from a measured constant. An operand may be exact, with value_type as its representation.

Return Value

Note

The return value should not be discarded.

Parameters

NameDescription
coverage_factorThe coverage factor, 2 (about 95 %) by default