CPP07 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
iter.hpp ファイル

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

#include <cstddef>
#include <iostream>
iter.hpp の依存先関係図:
被依存関係図:

[ソースコード]

関数

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 に定義があります。

関数詳解

◆ incrementElement()

template<typename T >
void incrementElement ( T element)

Increments a numeric element.

テンプレート引数
TThe type of the element.
引数
elementThe element to increment.

iter.hpp72 行目に定義があります。

◆ iter() [1/2]

template<typename T >
void iter ( const T array,
size_t  length,
void(*)(const T &)  f 
)

Applies a function to each element of a const array. This version is for const arrays and does not allow modification of elements.

テンプレート引数
TThe type of the array elements.
引数
arrayA pointer to the beginning of the const array.
lengthThe number of elements in the array.
fA function to apply to each element. It takes a const reference.

iter.hpp49 行目に定義があります。

◆ iter() [2/2]

template<typename T >
void iter ( T array,
size_t  length,
void(*)(T &)  f 
)

Applies a function to each element of an array. This version is for non-const arrays and allows modification of elements.

テンプレート引数
TThe type of the array elements.
引数
arrayA pointer to the beginning of the array.
lengthThe number of elements in the array.
fA function to apply to each element. It takes a non-const reference.

iter.hpp32 行目に定義があります。

◆ printElement()

template<typename T >
void printElement ( const T &  element)

Prints an element to the standard output.

テンプレート引数
TThe type of the element.
引数
elementThe element to print.

iter.hpp65 行目に定義があります。