1
2// Copyright Oliver Kowalke 2013.
3// Distributed under the Boost Software License, Version 1.0.
4// (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7#ifndef BOOST_FIBERS_DETAIL_CONVERT_H
8#define BOOST_FIBERS_DETAIL_CONVERT_H
9
10#include <chrono>
11#include <memory>
12
13#include <boost/config.hpp>
14
15#include <boost/fiber/detail/config.hpp>
16
17#ifdef BOOST_HAS_ABI_HEADERS
18# include BOOST_ABI_PREFIX
19#endif
20
21namespace boost {
22namespace fibers {
23namespace detail {
24
25inline
26std::chrono::steady_clock::time_point convert(
27 std::chrono::steady_clock::time_point const& timeout_time) noexcept {
28 return timeout_time;
29}
30
31template< typename Clock, typename Duration >
32std::chrono::steady_clock::time_point convert(
33 std::chrono::time_point< Clock, Duration > const& timeout_time) {
34 return std::chrono::steady_clock::now() + ( timeout_time - Clock::now() );
35}
36
37}}}
38
39#ifdef BOOST_HAS_ABI_HEADERS
40# include BOOST_ABI_SUFFIX
41#endif
42
43#endif // BOOST_FIBERS_DETAIL_CONVERT_H
44

source code of boost/libs/fiber/include/boost/fiber/detail/convert.hpp