|
CPP07 1.0
|
Contains a template function to apply a function to each element of an array. [詳解]


関数 | |
| template<typename T > | |
| void | iter (T *array, size_t length, void(*f)(T &)) |
| Applies a function to each element of an array. This version is for non-const arrays and allows modification of elements. | |
| template<typename T > | |
| void | iter (const T *array, size_t length, void(*f)(const T &)) |
| Applies a function to each element of a const array. This version is for const arrays and does not allow modification of elements. | |
| template<typename T > | |
| void | printElement (const T &element) |
| Prints an element to the standard output. | |
| template<typename T > | |
| void | incrementElement (T &element) |
| Increments a numeric element. | |
Contains a template function to apply a function to each element of an array.
iter.hpp に定義があります。
Applies a function to each element of a const array. This version is for const arrays and does not allow modification of elements.
| T | The type of the array elements. |
| array | A pointer to the beginning of the const array. |
| length | The number of elements in the array. |
| f | A function to apply to each element. It takes a const reference. |
Applies a function to each element of an array. This version is for non-const arrays and allows modification of elements.
| T | The type of the array elements. |
| array | A pointer to the beginning of the array. |
| length | The number of elements in the array. |
| f | A function to apply to each element. It takes a non-const reference. |