Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83057 - sandbox/tuple-move/detail
From: adam.wulkiewicz_at_[hidden]
Date: 2013-02-20 23:07:27


Author: awulkiew
Date: 2013-02-20 23:07:27 EST (Wed, 20 Feb 2013)
New Revision: 83057
URL: http://svn.boost.org/trac/boost/changeset/83057

Log:
added tuple copy and move ctors
Text files modified:
   sandbox/tuple-move/detail/tuple_basic.hpp | 49 ++++++++++++++++++++++++++++-----------
   1 files changed, 35 insertions(+), 14 deletions(-)

Modified: sandbox/tuple-move/detail/tuple_basic.hpp
==============================================================================
--- sandbox/tuple-move/detail/tuple_basic.hpp (original)
+++ sandbox/tuple-move/detail/tuple_basic.hpp 2013-02-20 23:07:27 EST (Wed, 20 Feb 2013)
@@ -533,21 +533,34 @@
 class tuple :
   public detail::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
 {
- BOOST_COPYABLE_AND_MOVABLE(tuple)
+ BOOST_COPYABLE_AND_MOVABLE(tuple)
 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
- template <class HT2, class TT2>
- tuple& operator=(cons<HT2, TT2> & t)
- { this->operator=(static_cast<const ::boost::rv<cons<HT2, TT2> > &>(const_cast<const cons<HT2, TT2> &>(t))); return *this;}
- template <class U1, class U2>
- tuple& operator=(std::pair<U1, U2> & t)
- { this->operator=(static_cast<const ::boost::rv<std::pair<T1, T2> > &>(const_cast<const std::pair<T1, T2> &>(t))); return *this;}
-
- template <class HT2, class TT2>
- tuple& operator=(const cons<HT2, TT2> & t)
- { this->operator=(static_cast<const ::boost::rv<cons<HT2, TT2> > &>(t)); return *this;}
- template <class U1, class U2>
- tuple& operator=(const std::pair<U1, U2> & t)
- { this->operator=(static_cast<const ::boost::rv<std::pair<T1, T2> > &>(t)); return *this;}
+ template <class U0, class U1, class U2, class U3, class U4, class U5, class U6, class U7, class U8, class U9>
+ tuple& operator=(tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9> & t) {
+ typedef tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9> Tup;
+ this->operator=(static_cast<const ::boost::rv<Tup> &>(const_cast<const Tup &>(t)));
+ return *this;
+ }
+ template <class U0, class U1, class U2, class U3, class U4, class U5, class U6, class U7, class U8, class U9>
+ tuple& operator=(const tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9> & t) {
+ typedef tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9> Tup;
+ this->operator=(static_cast<const ::boost::rv<Tup> &>(t));
+ return *this;
+ }
+
+ template <class HT2, class TT2>
+ tuple& operator=(cons<HT2, TT2> & t)
+ { this->operator=(static_cast<const ::boost::rv<cons<HT2, TT2> > &>(const_cast<const cons<HT2, TT2> &>(t))); return *this;}
+ template <class HT2, class TT2>
+ tuple& operator=(const cons<HT2, TT2> & t)
+ { this->operator=(static_cast<const ::boost::rv<cons<HT2, TT2> > &>(t)); return *this;}
+
+ template <class U1, class U2>
+ tuple& operator=(std::pair<U1, U2> & t)
+ { this->operator=(static_cast<const ::boost::rv<std::pair<T1, T2> > &>(const_cast<const std::pair<T1, T2> &>(t))); return *this;}
+ template <class U1, class U2>
+ tuple& operator=(const std::pair<U1, U2> & t)
+ { this->operator=(static_cast<const ::boost::rv<std::pair<T1, T2> > &>(t)); return *this;}
 #endif
 
 public:
@@ -647,6 +660,14 @@
         typename access_traits<T9>::parameter_type t9)
     : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) {}
 
+ template <class U0, class U1, class U2, class U3, class U4, class U5, class U6, class U7, class U8, class U9>
+ tuple(const tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9> & p)
+ : inherited(static_cast<const typename tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>::inherited &>(p))
+ {}
+ template <class U0, class U1, class U2, class U3, class U4, class U5, class U6, class U7, class U8, class U9>
+ tuple(BOOST_RV_REF_BEG tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9> BOOST_RV_REF_END p)
+ : inherited(boost::move(static_cast<typename tuple<U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>::inherited &>(p)))
+ {}
 
   template<class U1, class U2>
   tuple(const cons<U1, U2>& p) : inherited(p) {}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk