----------------------------------------
To: boost-users@lists.boost.org From: giecrilj@stegny.2a.pl Date: Fri, 7 Oct 2011 11:18:24 +0200 Subject: Re: [Boost-users] a tuple from a pair?
Lars Viklund wrote:
Are you sure you're not misunderstanding what your implementation does? VC10 and GCC 4.4.5 makes (rightfully so) a 1-tuple with an element of type pair
when invoking make_tuple with a pair. What I mean is this:
#include
void trigger (::std:: pair < int, int > const &p) { ::boost:: get < 0 > (::boost:: tuple < int, int > (p)) == p. first; } error: no matching function for call to ‘boost::tuples::tuple
::tuple(const std::pair &)’ Compare:
#include
void trigger (::std:: pair < int, int > const &p) { ::std:: tr1:: get < 0 > (::std:: tr1:: tuple < int, int > (p)) == p. first; } I guess this, and Joel’s comment about boost fusion, means boost tuple should be deprecated.
Chris
If you use boost::fusion::at_c<0> rather than std::get<0> or boost::get<0>,
you don't even need to convert to a tuple