Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-06-19 11:07:55


[John Max Skaller]
1. From the doco:

--------------------------------------------------
The default delimiter between the elements is space,
and the tuple is enclosed in parenthesis. For Example:

tuple<float, int, std::string> a(1.0f, 2, std::string("Howdy folks!");

cout << a;

outputs the tuple as: 1.0 2 Howdy folks!
--------------------------------------------------

-- without paranthesis.
[Gary]
Got it!

[John Max Skaller]
2. Why the limit of 10 elements? Why not 20? Is the limit documented?
[Gary]
Laziness. :>,
No actually we were able to do the LL library with just 10. It would be easy
(almost mechanical) to extend it. In fact we used to have a set of MACRO's
which helped with this task.

At some point there will be a limit. What is reasonable? Do you even have a
use for 20? That's not saying it couldn't be done. In LL, we get around the
limit by creating tuples of tuples so that no layer has more than 10
arguments. It's not as tight a limit as it sounds. But again we could extend
it if there is a reason to.

[John Max Skaller]
3. How does one get a pointer to member? [ptm]
[Gary]
use bind? But then that assumes you want to hold an element as well.

How about this:

tuple<ResultType (ObjectType::*)()> foo(ResultType (ObjectType::* const &f)
() )
{
   return tuple<ResultType (ObjectType::*)()>(f);
}

Here a function foo, takes a member function f, from class ObjectType,
returning a ResultType, which takes no arguments.) And the function foo
returns a tuple holding that pointer to member.

And did you really want to know this, or just want us to put it in the docs?

  Yours,
 -gary-


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk