Boost logo

Boost-Commit :

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


Author: awulkiew
Date: 2013-02-20 21:37:22 EST (Wed, 20 Feb 2013)
New Revision: 83054
URL: http://svn.boost.org/trac/boost/changeset/83054

Log:
C++98 compile errors fixed
Text files modified:
   sandbox/tuple-move/detail/tuple_basic.hpp | 43 +++++++++++++++++++++++++++------------
   1 files changed, 30 insertions(+), 13 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 21:37:22 EST (Wed, 20 Feb 2013)
@@ -65,7 +65,7 @@
 } // end detail
 
 // - cons forward declaration -----------------------------------------------
-template <class HT, class TT> class cons;
+template <class HT, class TT> struct cons;
 
 
 // - tuple forward declaration -----------------------------------------------
@@ -255,21 +255,32 @@
 } // detail
 
 template <class HT, class TT>
-class cons {
-
- BOOST_COPYABLE_AND_MOVABLE(cons)
+struct cons {
 
 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
-public:
+
+ cons& operator=(cons & t)
+ { this->operator=(static_cast<const ::boost::rv<cons> &>(const_cast<const cons &>(t))); return *this;}
   template <class HT2, class TT2>
   cons& 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 T1, class T2>
   cons& operator=(std::pair<T1, T2> & t)
   { this->operator=(static_cast<const ::boost::rv<std::pair<T1, T2> > &>(const_cast<const std::pair<T1, T2> &>(t))); return *this;}
-#endif
 
-public:
+ template <class HT2, class TT2>
+ cons& operator=(const cons<HT2, TT2> & t)
+ { this->operator=(static_cast<const ::boost::rv<cons<HT2, TT2> > &>(t)); return *this;}
+ template <class T1, class T2>
+ cons& operator=(const std::pair<T1, T2> & t)
+ { this->operator=(static_cast<const ::boost::rv<std::pair<T1, T2> > &>(t)); return *this;}
+
+ operator ::boost::rv<cons>&()
+ { return *static_cast< ::boost::rv<cons>* >(this); }
+ operator const ::boost::rv<cons>&() const
+ { return *static_cast<const ::boost::rv<cons>* >(this); }
+
+#endif
 
   typedef HT head_type;
   typedef TT tail_type;
@@ -374,18 +385,24 @@
 };
 
 template <class HT>
-class cons<HT, null_type> {
-
- BOOST_COPYABLE_AND_MOVABLE(cons)
+struct cons<HT, null_type> {
 
 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
-public:
+ cons& operator=(cons & t)
+ { this->operator=(static_cast<const ::boost::rv<cons> &>(const_cast<const cons &>(t))); return *this;}
   template <class HT2>
   cons& operator=(cons<HT2, null_type> & t)
   { this->operator=(static_cast<const ::boost::rv<cons<HT2, null_type> > &>(const_cast<const cons<HT2, null_type> &>(t))); return *this;}
-#endif
 
-public:
+ template <class HT2>
+ cons& operator=(const cons<HT2, null_type> & t)
+ { this->operator=(static_cast<const ::boost::rv<cons<HT2, null_type> > &>(t)); return *this;}
+
+ operator ::boost::rv<cons>&()
+ { return *static_cast< ::boost::rv<cons>* >(this); }
+ operator const ::boost::rv<cons>&() const
+ { return *static_cast<const ::boost::rv<cons>* >(this); }
+#endif
 
   typedef HT head_type;
   typedef null_type tail_type;


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