Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-17 08:38:45

0001 /*
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * Copyright (c) 2025 Andrey Semashev
0007  */
0008 /*!
0009  * \file   atomic/has_posix_clock_traits.hpp
0010  *
0011  * This header contains utilities for working with \c posix_clock_traits.
0012  */
0013 
0014 #ifndef BOOST_ATOMIC_DETAIL_HAS_POSIX_CLOCK_TRAITS_HPP_INCLUDED_
0015 #define BOOST_ATOMIC_DETAIL_HAS_POSIX_CLOCK_TRAITS_HPP_INCLUDED_
0016 
0017 #include <sys/types.h> // clockid_t
0018 #include <type_traits>
0019 #include <boost/atomic/posix_clock_traits_fwd.hpp>
0020 #include <boost/atomic/detail/config.hpp>
0021 #include <boost/atomic/detail/header.hpp>
0022 
0023 #ifdef BOOST_HAS_PRAGMA_ONCE
0024 #pragma once
0025 #endif
0026 
0027 namespace boost {
0028 namespace atomics {
0029 namespace detail {
0030 
0031 template< typename Clock >
0032 struct has_posix_clock_traits_impl
0033 {
0034     template< typename T, clockid_t = posix_clock_traits< T >::clock_id >
0035     static std::true_type check_posix_clock_traits_clock_id(T*);
0036     static std::false_type check_posix_clock_traits_clock_id(...);
0037 
0038     using type = decltype(has_posix_clock_traits_impl< Clock >::check_posix_clock_traits_clock_id(static_cast< Clock* >(nullptr)));
0039 };
0040 
0041 //! Checks if there exists a specialization of \c posix_clock_traits for \c Clock
0042 template< typename Clock >
0043 using has_posix_clock_traits = typename has_posix_clock_traits_impl< Clock >::type;
0044 
0045 } // namespace detail
0046 } // namespace atomics
0047 } // namespace boost
0048 
0049 #include <boost/atomic/detail/footer.hpp>
0050 
0051 #endif // BOOST_ATOMIC_DETAIL_HAS_POSIX_CLOCK_TRAITS_HPP_INCLUDED_