DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
docwire::invocation_traits::is_invocable< T > Struct Template Reference

Trait that checks if a type is invocable. More...

#include <invocation_traits.h>

Static Public Attributes

static constexpr bool value
 Whether the type is invocable. More...
 

Detailed Description

template<typename T>
struct docwire::invocation_traits::is_invocable< T >

Trait that checks if a type is invocable.

This template provides a more flexible and convenient way to check if a type is invocable compared to std::is_invocable. Unlike std::is_invocable, this trait does not require specifying the argument types, making it easier to use with types that have complex or variable invocation signatures.

Additionally, this trait supports functors with overloaded operator() and other types that provide a public operator() signature through mechanisms such as invocation_args_t. This makes it a more comprehensive and robust solution for checking invocability.

The trait uses boost::callable_traits to check for invocability, and provides a fallback mechanism in cases where boost::callable_traits is not sufficient. The fallback mechanism relies on the presence of a public invocation_args_t type definition in the functor class.

Template Parameters
TThe type to check for invocability.

Definition at line 178 of file invocation_traits.h.

Member Data Documentation

◆ value

template<typename T >
constexpr bool docwire::invocation_traits::is_invocable< T >::value
staticconstexpr
Initial value:
=
requires { typename boost::callable_traits::args_t<T>; } ||
requires { typename std::decay_t<T>::invocation_args_t; }
requires(!string_method_equipped< T >) struct stringifier< T >
Specialization for types that are streamable to std::ostream.

Whether the type is invocable.

This value is true if the type is invocable, false otherwise.

Definition at line 185 of file invocation_traits.h.


The documentation for this struct was generated from the following file: