TooN Algorithm Library - tag  0.2
Classes | Macros | Typedefs | Variables
Tuple types of arbitrary length

Classes

struct  tag::T_list< C, D >
 
struct  tag::V_list< C, D >
 
struct  tag::V_tuple< A, B, C, >
 

Macros

#define make_tuple(...)   ((tag::TupleHead, ## __VA_ARGS__))
 
#define make_vtuple(...)   ((tag::V_TupleHead, ## __VA_ARGS__))
 
#define make_rtuple(...)   ((tag::R_TupleHead, ## __VA_ARGS__))
 

Typedefs

typedef T_list< Internal::null,
Internal::null > 
tag::T_ListEnd
 

Variables

static const T_ListEnd tag::TupleHead =T_ListEnd(Internal::null(), Internal::null())
 

Detailed Description

This group containg classes for dealing with tuples (or typelists) of arbitrary length.

There are two types:

V_list is designed primarily to allow multiple return values from functions (see also tag::rpair) and can be uses as follows:

V_tuple<int, float, char>::type func()
{
int i;
float f;
char c;
//Function body goes here
return make_vtuple(i, f, c);
}
void foo()
{
int a;
float b;
char c;
//Call func() and collect all return values
make_rtuple(a,b,c) = func();
//a,b,c are now set.
}

Macro Definition Documentation

#define make_rtuple (   ...)    ((tag::R_TupleHead, ## __VA_ARGS__))

This macro is used to collect multiple return values from a function.

#define make_tuple (   ...)    ((tag::TupleHead, ## __VA_ARGS__))

This is a variadic ``function'' which creates and returns a tuple.

Referenced by tag::computeSimilarity(), and find_roots().

#define make_vtuple (   ...)    ((tag::V_TupleHead, ## __VA_ARGS__))

This macro is used to return multiple values from a function.

Typedef Documentation

typedef T_list<Internal::null,Internal::null> tag::T_ListEnd

Guard type to mark the end of the list

Variable Documentation

const T_ListEnd tag::TupleHead =T_ListEnd(Internal::null(), Internal::null())
static

The value of the end of a list