common.hpp 542 B

123456789101112131415161718192021222324252627
  1. #ifndef SIMPLE_MOTION_COMMON_HPP
  2. #define SIMPLE_MOTION_COMMON_HPP
  3. #include "simple/support/range.hpp"
  4. namespace simple::motion
  5. {
  6. template <typename Duration>
  7. struct advance_result
  8. {
  9. bool done;
  10. Duration remaining{};
  11. explicit operator bool() { return done; } // negate?
  12. };
  13. template <typename Duration, typename It = size_t>
  14. struct multi_advance_result : public advance_result<Duration>
  15. {
  16. support::range<It> updated {};
  17. using advance_result<Duration>::operator bool;
  18. };
  19. } // namespace simple::motion
  20. #endif /* end of include guard */