Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] .at<N>() template member in containers?
From: Alfredo Correa (alfredo.correa_at_[hidden])
Date: 2010-10-06 16:36:28


On Wed, Oct 6, 2010 at 1:21 PM, Frank Mori Hess <frank.hess_at_[hidden]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wednesday 06 October 2010, alfC wrote:
> > Hi,
> >
> > Excuse my simple minded questions. Sometimes by asking this question
> > (often with negative answer) I understand more on the design of the
> > Boost libraries.
> >
> > Besides possible redundancy, why is that the fusion containers, for
> > example fusion::vector, doesn't have a template member function to
> > extract elements?
> >
> > fusion::vector<double, int, std::string> stuff(1.2, 3, "hola");
> > stuff.at<2>(); //returns "hola", just like at_c<2>(stuff);
>
> Wouldn't that require template specializations of the "at()" member
> template
> for its differing return types? IIRC, C++ doesn't let you specialize
> template members of template classes.
>

It does not seem to be a technical problem, tuples have member functions

tuples<int, double, string> t;
t.get<2>(); // a string

>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkys2mAACgkQ5vihyNWuA4Wd+wCff6IeuTbsJj0GVqPrqaGanKEG
> 9ogAoM/nwd7GCdR4IzYR2i5lBLhfyx1z
> =ojtF
> -----END PGP SIGNATURE-----
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
> --
> Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe Boost
> Users beigetreten sind.
> Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine
> E-Mail an boostusers_at_googlegroups.com.
> Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an
> boostusers+unsubscribe_at_[hidden]<boostusers%2Bunsubscribe_at_[hidden]>
> .
> Besuchen Sie die Gruppe unter
> http://groups.google.com/group/boostusers?hl=de, um weitere Optionen zu
> erhalten.
>
>



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