Boost logo

Boost :

From: Jarrad Waterloo (jwaterloo_at_[hidden])
Date: 2007-07-06 16:06:37


Dennis Bingaman,
        A handcrafted struct or class can beat a tuple in all categories
except one: time to define it. A tuple shines as a way to return multiple
values from a function without haven't to result to creating a struct/class
or worse changing the signature of the function/method by having them, the
return values, passed in as reference(s) or pointer(s) parameters. The
latter would obscure the innate documentation on how a function is to be
used. i.e. Is this parameter and in, in/out, or out parameter? Add onto all
of this all the methods and operators that get generated for you and the
tuple's ease of use become apparent.

-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
On Behalf Of Dennis D Bingaman
Sent: Friday, July 06, 2007 3:19 PM
To: boost_at_[hidden]
Subject: [boost] boost::tuples

I have been using the STL for some time now and have been investigating
possible use of the boost libraries in future projects. The most useful
library I have found so far was the boost::lamda library. I was reading
the documentation and experimenting around with the boost::tuples library.
 The documentation is excellent and very complete and now I understand how
to create tuples and maybe use them is some limited way. Thing is, I
can't seem to grasp what advantages there are of tuples over structures
and classes? Can someone tell me; what are the benefits of tuples over
structures or classes?

Thanks,
Dennis Bingaman
_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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