wait_traits.hpp 945 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // wait_traits.hpp
  3. // ~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_WAIT_TRAITS_HPP
  11. #define ASIO_WAIT_TRAITS_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/push_options.hpp"
  16. namespace asio {
  17. /// Wait traits suitable for use with the basic_waitable_timer class template.
  18. template <typename Clock>
  19. struct wait_traits
  20. {
  21. /// Convert a clock duration into a duration used for waiting.
  22. /**
  23. * @returns @c d.
  24. */
  25. static typename Clock::duration to_wait_duration(
  26. const typename Clock::duration& d)
  27. {
  28. return d;
  29. }
  30. };
  31. } // namespace asio
  32. #include "asio/detail/pop_options.hpp"
  33. #endif // ASIO_WAIT_TRAITS_HPP