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::chaining::function_to_function_binding< F1, F2 > Struct Template Reference

Binds a function to a function, enabling the creation of a function call chain. More...

#include <chaining.h>

Public Types

using invocation_args_t = decltype(std::tuple_cat(std::declval< tuple_utils::remove_last_t< invocation_traits::args_t< F1 > >>(), std::declval< tuple_utils::remove_first_t< invocation_traits::args_t< F2 > >>()))
 The type of the arguments of this functor.
 

Public Member Functions

template<typename... Args>
auto operator() (Args &&... args) const
 Calls the first function with second function as a callback. Divides and forwards arguments accordingly. More...
 

Public Attributes

ref_or_owned< F1 > function1
 First bound function.
 
ref_or_owned< F2 > function2
 Second bound function.
 

Detailed Description

template<invocation_concepts::invocable F1, invocation_concepts::invocable F2>
struct docwire::chaining::function_to_function_binding< F1, F2 >

Binds a function to a function, enabling the creation of a function call chain.

This class template takes two type parameters: F1 and F2 (the function types). It provides an operator() that allows the first function to be called with specified arguments and the second function as a callback.

Provided arguments are divided and forwarded to the first function and the second function according to their their arity.

Template Parameters
F1The type of the first function to be bound.
F2The type of the second function to be bound.
See also
docwire::invocation_concepts::invocable

Definition at line 116 of file chaining.h.

Member Function Documentation

◆ operator()()

template<invocation_concepts::invocable F1, invocation_concepts::invocable F2>
template<typename... Args>
auto docwire::chaining::function_to_function_binding< F1, F2 >::operator() ( Args &&...  args) const
inline

Calls the first function with second function as a callback. Divides and forwards arguments accordingly.

Template Parameters
ArgsThe types of the arguments.
Parameters
argsThe arguments.
Returns
The result of the function call.

Definition at line 138 of file chaining.h.


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