AutoPas  3.0.0
Loading...
Searching...
No Matches
Functions
autopas::utils::TupleUtils Namespace Reference

In this namespace some helper functions for std::tuple can be found. More...

Functions

template<class T , class F >
void for_each (T &&tuple, F &&f)
 Applies a function f on every element of the tuple.
 

Detailed Description

In this namespace some helper functions for std::tuple can be found.

Function Documentation

◆ for_each()

template<class T , class F >
void autopas::utils::TupleUtils::for_each ( T &&  tuple,
F &&  f 
)

Applies a function f on every element of the tuple.

Elements are processed in the order they are declared.

Note
Needs not be std::tuple but anything that satisfies std::apply.
Template Parameters
TType of the tuple
FType of the function
Parameters
tupleThe tuple to iterate
fThe function to apply. Typically [&](auto &elem) {...}