Share via


operator/ Operator (STL)

Division operator for duration objects.

template<class Rep1, class Period1, class Rep2>
   constexpr duration<typename common_type<Rep1, Rep2>::type, Period1>
   operator/(
      const duration<Rep1, Period1>& Dur,
      const Rep2& Div);
template<class Rep1, class Period1, class Rep2, class Period2>
   constexpr typename common_type<Rep1, Rep2>::type
   operator/(
      const duration<Rep1, Period1>& Left,
      const duration<Rep2, Period2>& Right);

Parameters

  • Dur
    A duration object.

  • Div
    An integral value.

  • Left
    The left duration object.

  • Right
    The right duration object.

Return Value

The first operator returns a duration object whose interval length is the length of Dur divided by the value Div.

The second operator returns the ratio of the interval lengths of Left and Right.

Unless is_convertible<Rep2, common_type<Rep1, Rep2>>holds true, and Rep2 is not an instantiation of duration, the first operator does not participate in overload resolution. For more information, see <type_traits>.

Requirements

Header: chrono

Namespace: std::chrono

See Also

Reference

<chrono>

Other Resources

Header Files