Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76244 - in branches/release/boost/icl: . concept
From: afojgo_at_[hidden]
Date: 2011-12-31 06:41:31


Author: jofaber
Date: 2011-12-31 06:41:30 EST (Sat, 31 Dec 2011)
New Revision: 76244
URL: http://svn.boost.org/trac/boost/changeset/76244

Log:
Merged revision [76235]. Added move semantics for binary operators.
Properties modified:
   branches/release/boost/icl/ (props changed)
Text files modified:
   branches/release/boost/icl/concept/interval_associator.hpp | 315 +++++++++++++++++++++++++++++++++++++++
   1 files changed, 314 insertions(+), 1 deletions(-)

Modified: branches/release/boost/icl/concept/interval_associator.hpp
==============================================================================
--- branches/release/boost/icl/concept/interval_associator.hpp (original)
+++ branches/release/boost/icl/concept/interval_associator.hpp 2011-12-31 06:41:30 EST (Sat, 31 Dec 2011)
@@ -325,6 +325,7 @@
 }
 
 
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op + (T, c P&) T:{S}|{M} P:{e i S}|{b p M}
 //------------------------------------------------------------------------------
@@ -339,6 +340,26 @@
     return object += operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator + (const Type& object, const OperandT& operand)
+{
+ Type temp = object;
+ return boost::move(temp += operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator + (Type&& object, const OperandT& operand)
+{
+ return boost::move(object += operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op + (c P&, T) T:{S}|{M} P:{e i S'}|{b p M'}
 //------------------------------------------------------------------------------
@@ -353,6 +374,26 @@
     return object += operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator + (const OperandT& operand, const Type& object)
+{
+ Type temp = object;
+ return boost::move(temp += operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator + (const OperandT& operand, Type&& object)
+{
+ return boost::move(object += operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op + (T, c P&) T:{S}|{M} P:{S}|{M}
 //------------------------------------------------------------------------------
@@ -367,6 +408,38 @@
     return object += operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator + (const Type& object, const Type& operand)
+{
+ Type temp = object;
+ return boost::move(temp += operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator + (Type&& object, const Type& operand)
+{
+ return boost::move(object += operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator + (const Type& operand, Type&& object)
+{
+ return boost::move(object += operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator + (Type&& object, Type&& operand)
+{
+ return boost::move(object += operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
 
 //------------------------------------------------------------------------------
 //- Addition |=, |
@@ -404,6 +477,7 @@
     return object += operand;
 }
 
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op | (T, c P&) T:{S}|{M} P:{e i S}|{b p M}
 //------------------------------------------------------------------------------
@@ -418,6 +492,26 @@
     return object += operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator | (const Type& object, const OperandT& operand)
+{
+ Type temp = object;
+ return boost::move(temp += operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator | (Type&& object, const OperandT& operand)
+{
+ return boost::move(object += operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op | (T, c P&) T:{S}|{M} P:{S}|{M}
 //------------------------------------------------------------------------------
@@ -432,6 +526,26 @@
     return object += operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator | (const OperandT& operand, const Type& object)
+{
+ Type temp = object;
+ return boost::move(temp += operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator | (const OperandT& operand, Type&& object)
+{
+ return boost::move(object += operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op | (T, c P&) T:{S}|{M} P:{S}|{M}
 //------------------------------------------------------------------------------
@@ -445,6 +559,39 @@
 {
     return object += operand;
 }
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator | (const Type& object, const Type& operand)
+{
+ Type temp = object;
+ return boost::move(temp += operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator | (Type&& object, const Type& operand)
+{
+ return boost::move(object += operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator | (const Type& operand, Type&& object)
+{
+ return boost::move(object += operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator | (Type&& object, Type&& operand)
+{
+ return boost::move(object += operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
 
 //==============================================================================
 //= Insertion<IntervalSet|IntervalSet>
@@ -560,7 +707,7 @@
     return erase(object, operand);
 }
 
-
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op - (T, c P&) T:{S}|{M} P:{e i S'}|{e i b p S' M'}
 //------------------------------------------------------------------------------
@@ -571,6 +718,24 @@
     return object -= operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_right_inter_combinable<Type, OperandT>, Type>::type
+operator - (const Type& object, const OperandT& operand)
+{
+ Type temp = object;
+ return boost::move(temp -= operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_right_inter_combinable<Type, OperandT>, Type>::type
+operator - (Type&& object, const OperandT& operand)
+{
+ return boost::move(object -= operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
 
 //==============================================================================
 //= Intersection<IntervalSet|IntervalSet>
@@ -611,6 +776,7 @@
     return object;
 }
 
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op & (T, c P&) T:{S}|{M} P:{e i S'}|{e i b p S' M'} S<S' M<M' <:coarser
 //------------------------------------------------------------------------------
@@ -621,6 +787,26 @@
     return object &= operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_inter_combinable<Type, OperandT>, Type>::type
+operator & (const Type& object, const OperandT& operand)
+{
+ Type temp = object;
+ return boost::move(temp &= operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_inter_combinable<Type, OperandT>, Type>::type
+operator & (Type&& object, const OperandT& operand)
+{
+ return boost::move(object &= operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op & (c P&, T) T:{S}|{M} P:{e i S'}|{e i b p S' M'} S<S' M<M' <:coarser
 //------------------------------------------------------------------------------
@@ -631,6 +817,26 @@
     return object &= operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_inter_combinable<Type, OperandT>, Type>::type
+operator & (const OperandT& operand, const Type& object)
+{
+ Type temp = object;
+ return boost::move(temp &= operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_inter_combinable<Type, OperandT>, Type>::type
+operator & (const OperandT& operand, Type&& object)
+{
+ return boost::move(object &= operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op & (T, c T&) T:{S M}
 //------------------------------------------------------------------------------
@@ -641,6 +847,39 @@
     return object &= operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator & (const Type& object, const Type& operand)
+{
+ Type temp = object;
+ return boost::move(temp &= operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator & (Type&& object, const Type& operand)
+{
+ return boost::move(object &= operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator & (const Type& operand, Type&& object)
+{
+ return boost::move(object &= operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator & (Type&& object, Type&& operand)
+{
+ return boost::move(object &= operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
 //------------------------------------------------------------------------------
 //- intersects<IntervalSet|IntervalMap>
 //------------------------------------------------------------------------------
@@ -772,6 +1011,7 @@
     return icl::flip(object, operand);
 }
 
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op ^ (T, c P&) T:{S}|{M} P:{e i S'}|{b p M'} S<S' M<M' <:coarser
 //------------------------------------------------------------------------------
@@ -782,6 +1022,26 @@
     return object ^= operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator ^ (const Type& object, const OperandT& operand)
+{
+ Type temp = object;
+ return boost::move(temp ^= operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator ^ (Type&& object, const OperandT& operand)
+{
+ return boost::move(object ^= operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op ^ (c P&, T) T:{S}|{M} P:{e i S'}|{b p M'} S<S' M<M' <:coarser
 //------------------------------------------------------------------------------
@@ -792,6 +1052,26 @@
     return object ^= operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator ^ (const OperandT& operand, const Type& object)
+{
+ Type temp = object;
+ return boost::move(temp ^= operand);
+}
+
+template<class Type, class OperandT>
+typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
+operator ^ (const OperandT& operand, Type&& object)
+{
+ return boost::move(object ^= operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_NO_RVALUE_REFERENCES
 //------------------------------------------------------------------------------
 //- T op ^ (T, c T&) T:{S M}
 //------------------------------------------------------------------------------
@@ -802,6 +1082,39 @@
     return object ^= operand;
 }
 
+#else //BOOST_NO_RVALUE_REFERENCES
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator ^ (const Type& object, const Type& operand)
+{
+ Type temp = object;
+ return boost::move(temp ^= operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator ^ (Type&& object, const Type& operand)
+{
+ return boost::move(object ^= operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator ^ (const Type& operand, Type&& object)
+{
+ return boost::move(object ^= operand);
+}
+
+template<class Type>
+typename enable_if<is_interval_container<Type>, Type>::type
+operator ^ (Type&& object, Type&& operand)
+{
+ return boost::move(object ^= operand);
+}
+
+#endif //BOOST_NO_RVALUE_REFERENCES
+
 //==========================================================================
 //= Element Iteration <IntervalSet|IntervalMap>
 //==========================================================================


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