The NestedInitializerListsProcessor class.
More...
#include <vclib/misc/nested_initializer_lists.h>
template<
typename T, std::size_t L>
class vcl::NestedInitializerListsProcessor< T, L >
The NestedInitializerListsProcessor class.
Proposes some helper static functions that allows to process vcl::NestedInitializerLists of L levels.
◆ maxDimensionsLevels()
Returns a list containing the maximum size of elements for every dimension.
{{2, 3, 5, 4}, {2}, {2, 4, 6}});
{
{{2, 3}, {5, 4}, {6}, {2, 5}},
{{2}, {3, 4, 6}}
} );
static std::list< size_t > maxDimensionsLevels(NestedInitializerLists< T, L > values)
Returns a list containing the maximum size of elements for every dimension.
Definition nested_initializer_lists.h:103
- Parameters
-
[in] | values | the nested initializer lists |
- Returns
- a list of L numbers, where every number is the maximum size of elements for every dimension.
◆ processElements() [1/2]
Applies the lambda function passed as parameter to all the elements of the NestedInitializerLists.
Example: save all the elements in a vector:
std::vector<T> v;
typename std::vector<T>::iterator iterator = v.begin();
[&iterator](T value) { *(iterator++) = value; });
static void processElements(NestedInitializerLists< T, L > values, T_Function function)
Applies the lambda function passed as parameter to all the elements of the NestedInitializerLists.
Definition nested_initializer_lists.h:155
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
- Note
- This function does not take into account the sizes of every list. If some values are missing from the lists they will be skipped and function is not applied.
- Parameters
-
values | |
function | a lambda function that takes an argument of type T as input. |
◆ processElements() [2/2]
Applies the lambda function passed as parameter to all the elements of the NestedInitializerLists.
Example: save all the elements in a vector:
std::vector<T> v;
std::list<std::size_t>
sizes;
typename std::vector<T>::iterator iterator = v.begin();
[&iterator](T value) { *(iterator++) = value; });
- Note
- This function takes into account the sizes of every list fits every list in the given sizes. If some values are missing in a list, a zero vale casted to the type T is assed to the function.
- Parameters
-
values | |
function | a lambda function that takes an argument of type T as input. |
sizes | |
The documentation for this class was generated from the following file: