23 May 00:13
Re: tuple type question
From: Noah Roberts <roberts.noah <at> gmail.com>
Subject: Re: tuple type question
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-22 22:13:45 GMT
Subject: Re: tuple type question
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-22 22:13:45 GMT
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.
RSS Feed