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)
7 #ifndef BOOST_FIBERS_DETAIL_CONVERT_H
8 #define BOOST_FIBERS_DETAIL_CONVERT_H
13 #include <boost/config.hpp>
15 #include <boost/fiber/detail/config.hpp>
17 #ifdef BOOST_HAS_ABI_HEADERS
18 # include BOOST_ABI_PREFIX
26 std::chrono::steady_clock::time_point convert(
27 std::chrono::steady_clock::time_point const& timeout_time) noexcept {
31 template< typename Clock, typename Duration >
32 std::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() );
37 // suggested by Howard Hinnant
38 template< typename T >
40 T * convert( T * p) noexcept {
44 template< typename Pointer >
46 typename std::pointer_traits< Pointer >::element_type *
47 convert( Pointer p) noexcept {
49 ? to_raw_pointer( p.operator->() )
55 #ifdef BOOST_HAS_ABI_HEADERS
56 # include BOOST_ABI_SUFFIX
59 #endif // BOOST_FIBERS_DETAIL_CONVERT_H