|
ThreadSchedule 1.0.0
Modern C++ thread management library
|
C++20 concepts, type traits, and SFINAE helpers for the threading library. More...
#include <chrono>#include <functional>#include <set>#include <thread>#include <type_traits>#include <vector>Go to the source code of this file.
Classes | |
| struct | threadschedule::is_duration_impl< T, typename > |
| SFINAE trait that detects std::chrono::duration types. More... | |
| struct | threadschedule::is_duration_impl< T, std::void_t< typename T::rep, typename T::period > > |
| SFINAE trait that detects std::chrono::duration types. More... | |
| struct | threadschedule::is_thread_like< T > |
| Type trait that identifies thread-like types. More... | |
| struct | threadschedule::is_thread_like< std::thread > |
| std::thread is a thread-like type. More... | |
Typedefs | |
| template<typename T> | |
| using | threadschedule::enable_if_thread_callable_t = std::enable_if_t<std::is_invocable_v<T>, int> |
| Helper type traits for thread operations. | |
| template<typename T> | |
| using | threadschedule::enable_if_duration_t = std::enable_if_t<is_duration_impl<T>::value, int> |
Variables | |
| template<typename F, typename... Args> | |
| constexpr bool | threadschedule::ThreadCallable = std::is_invocable_v<F, Args...> |
| Pre-C++20 fallback for ThreadCallable (constexpr bool). | |
| template<typename T> | |
| constexpr bool | threadschedule::ThreadIdentifiable = std::is_same_v<decltype(std::declval<T>().get_id()), std::thread::id> |
| Pre-C++20 fallback for ThreadIdentifiable (constexpr bool). | |
| template<typename T> | |
| constexpr bool | threadschedule::Duration = is_duration_impl<T>::value |
| Pre-C++20 fallback for Duration (constexpr bool). | |
| template<typename T> | |
| constexpr bool | threadschedule::PriorityType = std::is_integral_v<T> |
| Pre-C++20 fallback for PriorityType (constexpr bool). | |
| template<typename T> | |
| constexpr bool | threadschedule::CPUSetType = std::is_same_v<T, std::vector<int>> || std::is_same_v<T, std::set<int>> |
| Pre-C++20 fallback for CPUSetType (constexpr bool). | |
| template<typename T> | |
| constexpr bool | threadschedule::is_thread_like_v = is_thread_like<T>::value |
| Convenience variable template for is_thread_like. | |
C++20 concepts, type traits, and SFINAE helpers for the threading library.
Provides compile-time constraints (ThreadCallable, ThreadIdentifiable, Duration, PriorityType, CPUSetType) used throughout the library to enforce correct template arguments. When C++20 concepts are unavailable, equivalent constexpr bool variables are defined as fallbacks.
Also defines the is_thread_like<T> trait hierarchy for generic thread handle dispatch.
Definition in file concepts.hpp.
| using threadschedule::enable_if_duration_t = std::enable_if_t<is_duration_impl<T>::value, int> |
Definition at line 173 of file concepts.hpp.
| using threadschedule::enable_if_thread_callable_t = std::enable_if_t<std::is_invocable_v<T>, int> |
Helper type traits for thread operations.
Definition at line 170 of file concepts.hpp.
|
constexpr |
Pre-C++20 fallback for CPUSetType (constexpr bool).
Definition at line 123 of file concepts.hpp.
|
constexpr |
Pre-C++20 fallback for Duration (constexpr bool).
Definition at line 115 of file concepts.hpp.
|
inlineconstexpr |
Convenience variable template for is_thread_like.
Definition at line 164 of file concepts.hpp.
|
constexpr |
Pre-C++20 fallback for PriorityType (constexpr bool).
Definition at line 119 of file concepts.hpp.
|
constexpr |
Pre-C++20 fallback for ThreadCallable (constexpr bool).
Definition at line 107 of file concepts.hpp.
|
constexpr |
Pre-C++20 fallback for ThreadIdentifiable (constexpr bool).
Definition at line 111 of file concepts.hpp.