Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-02-14 07:06:13


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?

Many thanks,

John Maddock.


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