Boost logo

Boost Users :

From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2008-05-22 18:13:45


Olaf Peter wrote:

> why not simple derive:
>
> struct Test
> : boost::tuple<int,char>
> {
> enum Members { NAME, VALUE };
> };
>
> Than you have the tuple calling syntax:
>
> get<Test::Name>( ... )
>
> That's what I use for reading and writing "named" tuples.

How useful have people found this technique? I started using tuples for
simple data structures and did such a thing. I found that it added more
syntatic complexity than was of benefit; that simply creating a data
store class/POD was the easier, clearer method.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net