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::tuple_utils Namespace Reference

Provides transformations for tuples. More...

Typedefs

template<std::size_t Start, std::size_t Length, typename T >
using subrange_t = decltype(subrange< Start, Length >(std::declval< T >()))
 Type alias for the type of the result of subrange of a tuple. More...
 
template<typename T >
using remove_first_t = decltype(remove_first(std::declval< T >()))
 Type alias for the type of the result of removing the first element from a tuple. More...
 
template<typename T >
using remove_last_t = decltype(remove_last(std::declval< T >()))
 Type alias for the type of the result of removing the last element from a tuple. More...
 
template<typename T >
using first_element_t = decltype(first_element(std::declval< T >()))
 Type alias for the type of the first element of a tuple. More...
 
template<typename T >
using last_element_t = decltype(last_element(std::declval< T >()))
 Type alias for the type of the last element of a tuple. More...
 

Functions

template<std::size_t Start, std::size_t Length, typename... Ts>
auto subrange (const std::tuple< Ts... > &tuple)
 Returns subrange of a tuple. More...
 
template<typename T >
auto remove_first (T &&tuple)
 Removes the first element from a tuple. More...
 
template<typename T >
auto remove_last (T &&tuple)
 Removes the last element from a tuple. More...
 
template<typename T >
auto first_element (T &&tuple)
 Returns the first element of a tuple. More...
 
template<typename T >
auto last_element (T &&tuple)
 Returns the last element of a tuple. More...
 

Detailed Description

Provides transformations for tuples.

This namespace contains transformations that can be used to manipulate tuple types.

Typedef Documentation

◆ first_element_t

template<typename T >
using docwire::tuple_utils::first_element_t = typedef decltype(first_element(std::declval<T>()))

Type alias for the type of the first element of a tuple.

Template Parameters
TThe tuple type to return the first element of.
See also
first_element

Definition at line 121 of file tuple_utils.h.

◆ last_element_t

template<typename T >
using docwire::tuple_utils::last_element_t = typedef decltype(last_element(std::declval<T>()))

Type alias for the type of the last element of a tuple.

Template Parameters
TThe tuple type to return the last element of.
See also
last_element

Definition at line 142 of file tuple_utils.h.

◆ remove_first_t

template<typename T >
using docwire::tuple_utils::remove_first_t = typedef decltype(remove_first(std::declval<T>()))

Type alias for the type of the result of removing the first element from a tuple.

Template Parameters
TThe tuple type to remove the first element from.
See also
remove_first

Definition at line 76 of file tuple_utils.h.

◆ remove_last_t

template<typename T >
using docwire::tuple_utils::remove_last_t = typedef decltype(remove_last(std::declval<T>()))

Type alias for the type of the result of removing the last element from a tuple.

Template Parameters
TThe tuple type to remove the last element from.
See also
remove_last

Definition at line 100 of file tuple_utils.h.

◆ subrange_t

template<std::size_t Start, std::size_t Length, typename T >
using docwire::tuple_utils::subrange_t = typedef decltype(subrange<Start, Length>(std::declval<T>()))

Type alias for the type of the result of subrange of a tuple.

Template Parameters
TThe tuple type to return the subrange of.
See also
subrange

Definition at line 52 of file tuple_utils.h.

Function Documentation

◆ first_element()

template<typename T >
auto docwire::tuple_utils::first_element ( T &&  tuple)

Returns the first element of a tuple.

Parameters
tupleThe tuple to return the first element of.
Returns
The first element of the tuple.

Definition at line 109 of file tuple_utils.h.

◆ last_element()

template<typename T >
auto docwire::tuple_utils::last_element ( T &&  tuple)

Returns the last element of a tuple.

Parameters
tupleThe tuple to return the last element of.
Returns
The last element of the tuple.

Definition at line 130 of file tuple_utils.h.

◆ remove_first()

template<typename T >
auto docwire::tuple_utils::remove_first ( T &&  tuple)

Removes the first element from a tuple.

This function provides a way to remove the first element from a tuple, resulting in a new tuple with the remaining elements.

Parameters
tupleThe tuple to remove the first element from.
Returns
The new tuple with the first element removed.

Definition at line 64 of file tuple_utils.h.

◆ remove_last()

template<typename T >
auto docwire::tuple_utils::remove_last ( T &&  tuple)

Removes the last element from a tuple.

This function provides a way to remove the last element from a tuple, resulting in a new tuple with the remaining elements.

Parameters
tupleThe tuple to remove the last element from.
Returns
The new tuple with the last element removed.

Definition at line 88 of file tuple_utils.h.

◆ subrange()

template<std::size_t Start, std::size_t Length, typename... Ts>
auto docwire::tuple_utils::subrange ( const std::tuple< Ts... > &  tuple)

Returns subrange of a tuple.

Parameters
tThe tuple to return the subrange of.
Template Parameters
StartThe start index of the subrange.
LengthThe length of the subrange.
Returns
The subrange of the tuple.

Definition at line 35 of file tuple_utils.h.