Boost logo

Boost :

From: Edward Diener (eddielee_at_[hidden])
Date: 2005-02-14 19:40:20


Howard Hinnant wrote:
> On Feb 14, 2005, at 7:06 AM, John Maddock wrote:
>
>> The following simple patch to tuple_basic.hpp allows tuples to be
>> constructed from std::pairs (there is already an assignment operator,
>> but the copy constructor is missing for some reason, and is required
>> for TR1 conformity).
>>
>> RCS file: /cvsroot/boost/boost/boost/tuple/detail/tuple_basic.hpp,v
>> retrieving revision 1.28
>> diff -r1.28 tuple_basic.hpp
>> 627a628,636
>>> template <class T, class U>
>>> tuple(const std::pair<T, U>& p)
>>> : inherited(p.first, p.second, detail::cnull(), detail::cnull(),
>>> detail::cnull(), detail::cnull(), detail::cnull(),
>>> detail::cnull(), detail::cnull(), detail::cnull())
>>> {
>>> BOOST_STATIC_ASSERT(length<tuple>::value == 2);// check_length
>>> = 2 }
>>>
>>
>> Is it acceptable to add this?
>
> I think we could do better, but it would be stretching TR1 (which I
> think is good).
>
> I think any compatible tuple-like type should be convertible to tuple
> (pair, array, maybe complex?, anything else that declares itself
> tuple-like and implements the tuple interface).

What is the technical definition of a tuple-like type ?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk