|
Boost Users : |
From: Graham Reitz (graham.cpp_at_[hidden])
Date: 2007-07-25 23:50:24
Yes, thanks Joel.
I should have used more elements in my example and not called it some_pair.
Graham
On 7/25/07, Joel de Guzman <joel_at_[hidden]> wrote:
> Richard Dingwall wrote:
> >
> >
> > On 7/26/07, *Graham Reitz* <graham.cpp_at_[hidden]
> > <mailto:graham.cpp_at_[hidden]>> wrote:
> >
> > Ok good. So it sounds like my concern isn't justified.
> >
> > To be certain. Because of tuples I prefer this:
> >
> > typedef boost::tuples::tuple<unsigned int, double> some_pair;
> > typedef std::vector<some_pair > some_pairs;
> >
> > to this:
> > struct some_pair
> > { unsigned int i; double d; };
> > typedef std::vector<some_pair > some_pairs;
> >
> > Is tuples meant to be used like the first example?
> >
> >
> > Pardon me if it's just a two-dimensional example for simplicity, but why
> > not use std::pair?
>
> The op's intent is to use tuple instead of struct: "in situations where
> I might use a struct I am tend to prefer a tuple". std::pair is ok if
> the struct to be replaced has 2 elements. This is not always the case.
>
> Regards,
> --
> Joel de Guzman
> http://www.boost-consulting.com
> http://spirit.sf.net
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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