Boost logo

Boost :

From: jaakko.jarvi_at_[hidden]
Date: 2001-04-25 05:51:03


Tuples, previously part of the lambda library, is now
a separate library. We've placed it into Files section under
the directory Tuple.

We'd appreciate comments in order to finalize the library for
formal review. New features in the library include:

- comparison operators (<,>,<=,>= implement the lexicographical
- streaming, with some manipulators to control how to stream tuples
- thanks to Doug Gregor, tuples now work (almost fully) with MSVC

For those, who don't rember what tuple library is about:

Tuples generalise the standard pair to arbitrary number of elements
and to a wider range of allowable element types. Tuples are convenient
with functions that return several values. For example:

// define a function with 3 return values
tuple<int, int, double> add_multiply_divide(int a, int b){
  return make_tuple(a+b, a*b, double(a)/b);

// call the function
int a, b; double c;
tie (a, b, c) = add_multiply_divide(1, 2);

Now a == 3, b == 2 and c == 0.5

Cheers, Jaakko & Gary

Boost list run by bdawes at, gregod at, cpdaniel at, john at