30#ifdef USE_STD_CONCEPTS
46template<
typename Rep,
typename Period>
55template<
typename T,
typename =
void>
68template<
typename T,
typename =
void>
82struct is_future_like : std::bool_constant<has_get_method_v<T> && has_wait_method_v<T>> {};
90template<
typename F,
typename =
void>
97 using type = std::invoke_result_t<F>;
107#ifdef USE_STD_CONCEPTS
113concept Callable = std::is_invocable_v<F>;
130template<
typename F,
typename... Args>
155concept JobType = std::is_enum_v<T> ||
156 (std::is_integral_v<T> && !std::is_same_v<T, bool>);
167 (std::is_void_v<std::invoke_result_t<F>> ||
168 std::is_same_v<std::invoke_result_t<F>,
bool> ||
169 std::is_convertible_v<std::invoke_result_t<F>, std::string>);
178template<
typename Job>
181 std::is_convertible_v<callable_return_type_t<Job>,
bool>);
192inline constexpr bool Callable = std::is_invocable_v<F>;
199 std::is_void_v<std::invoke_result_t<F>>;
206 !std::is_void_v<std::invoke_result_t<F>>;
211template<
typename F,
typename... Args>
230inline constexpr bool JobType = std::is_enum_v<T> ||
231 (std::is_integral_v<T> && !std::is_same_v<T, bool>);
238 (std::is_void_v<std::invoke_result_t<F>> ||
239 std::is_same_v<std::invoke_result_t<F>,
bool> ||
240 std::is_convertible_v<std::invoke_result_t<F>, std::string>);
245template<
typename Job>
248 std::is_convertible_v<callable_return_type_t<Job>,
bool>);
259template<
typename T,
typename =
void>
296#ifdef USE_STD_CONCEPTS
317template<
typename F,
typename... Args>
332template<
typename Job>
typename callable_return_type< F >::type callable_return_type_t
constexpr bool has_wait_method_v
constexpr bool ReturningCallable
Fallback for ReturningCallable concept.
constexpr bool Callable
Fallback for Callable concept.
constexpr bool JobCallable
Fallback for JobCallable concept.
constexpr bool VoidCallable
Fallback for VoidCallable concept.
constexpr bool is_duration_v
constexpr bool FutureLike
Fallback for FutureLike concept.
constexpr bool PoolJob
Fallback for PoolJob concept.
constexpr bool CallableWith
Fallback for CallableWith concept.
constexpr bool is_future_like_v
constexpr bool is_valid_job_type_v
constexpr bool has_get_method_v
constexpr bool JobType
Fallback for JobType concept.
constexpr bool is_nothrow_callable_v
constexpr bool Duration
Fallback for Duration concept.
constexpr bool CallableWith
constexpr bool VoidCallable
constexpr bool ReturningCallable
constexpr bool FutureLike
constexpr bool JobCallable
std::invoke_result_t< F > type
Type trait to extract return type from a callable.
SFINAE helper to detect if a type has a get() method.
SFINAE helper to detect if a type has a wait() method.
Type trait to detect if a type is a std::chrono::duration.
Type trait to detect future-like types (has get() and wait() methods)
Helper to check if a callable is noexcept.
SFINAE helper for JobType validation.