共用方式為


operator % Operator (STL)

Operator for modulo operations on 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 function returns a duration object whose interval length is Dur modulo Div.

The second function returns a value that represents Left modulo Right.

Requirements

Header: chrono

Namespace: std::chrono

See Also

Other Resources

C++ Standard Library Header Files