ForEach Class Reference

#include <tuple.h>

Detailed Description

The constructor of ForEach allows to iterate over the values of a variadic parameter. The iteration will happen in the correct order. Example:

template <typename... T> T Sum(T... values)
{
T s = T();
ForEach{s += values...};
return s;
}
Warning
MSVC bug: the evaluation of an initializer list shall be in the correct order (8.5.4.4 List-initialization), but MSVC doesn't stick with this. Therefore, the order of the iteration is unspecified when using MSVC.

Public Member Functions

template<typename... ARGS>
 ForEach (ARGS &&...)
 

Constructor & Destructor Documentation

◆ ForEach()

ForEach ( ARGS &&  ...)
explicit
maxon::ForEach::ForEach
ForEach(ARGS &&...)
Definition: tuple.h:27