#include <utils.h>
Static Public Member Functions | |
template<typename T> | |
static void | swap (T &a, T &b) |
template<typename T> | |
static void | foreach (const Collection< T > &c, UnaryFunction< T, void > &fobj) |
template<typename T> | |
static void | foreach (const Collection< T > &c, void(*fptr)(const T &t)) |
template<typename T> | |
static void | foreach (const Collection< T > &c, void(*fptr)(T &t)) |
template<typename T> | |
static void | foreach (const Collection< T > &c, void(*fptr)(T t)) |
swap
, foreach
etc. These are functions are static members of the class. However, there are suitable defines available which enable the user to use the functions directly, instead of resolving the scope through Utils::
. static void seal::Utils::swap | ( | T & | a, | |
T & | b | |||
) | [inline, static] |
Swaps the values of two variables whose references are passed to the function. The variables' type should support a valid assignment operator. The following define is available so that the user can use this function directly.
#define swap(a, b) Utils::swap(a, b)
static void seal::Utils::foreach | ( | const Collection< T > & | c, | |
UnaryFunction< T, void > & | fobj | |||
) | [inline, static] |
This foreach function is similar to the STL for_each function. Each element of the collection (which is passed as a reference argument to the foreach function) is passed as an argument to the UnaryFunction
object (which is also an argument to the foreach function). The following define is available so that the user can use this function directly.
#define foreach(a, b) Utils::foreach(a, b)
c | The collection object over whose elements the foreach function will iterator over. | |
fobj | The UnaryFunction object to which the elements of the collections will be passed as arguments. |
static void seal::Utils::foreach | ( | const Collection< T > & | c, | |
void(*)(const T &t) | fptr | |||
) | [inline, static] |
This foreach function is similar to the STL for_each function, except that the elements of a collection passed to a function, instead of a UnaryFunction
object. Each element of the collection (which is passed as a reference argument to the foreach function) is passed as an argument to a function a pointer to which is also an argument to the foreach function.The following define is available so that the user can use this function directly.
#define foreach(a, b) Utils::foreach(a, b)
c | The collection object over whose elements the foreach function will iterator over. | |
fptr | The pointer to the function to which the elements of the collections will be passed as arguments. |
static void seal::Utils::foreach | ( | const Collection< T > & | c, | |
void(*)(T &t) | fptr | |||
) | [inline, static] |
This foreach function is similar to the STL for_each function, except that the elements of a collection passed to a function, instead of a UnaryFunction
object. Each element of the collection (which is passed as a reference argument to the foreach function) is passed as an argument to a function a pointer to which is also an argument to the foreach function. The following define is available so that the user can use this function directly.
#define foreach(a, b) Utils::foreach(a, b)
c | The collection object over whose elements the foreach function will iterator over. | |
fptr | The pointer to the function to which the elements of the collections will be passed as arguments. |
static void seal::Utils::foreach | ( | const Collection< T > & | c, | |
void(*)(T t) | fptr | |||
) | [inline, static] |
This foreach function is similar to the STL for_each function, except that the elements of a collection passed to a function, instead of a UnaryFunction
object. Each element of the collection (which is passed as a reference argument to the foreach function) is passed as an argument to a function a pointer to which is also an argument to the foreach function. The following define is available so that the user can use this function directly.
#define foreach(a, b) Utils::foreach(a, b)
c | The collection object over whose elements the foreach function will iterator over. | |
fptr | The pointer to the function to which the elements of the collections will be passed as arguments. |