Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65727 - sandbox/opaque/boost/opaque/meta_mixin
From: vicente.botet_at_[hidden]
Date: 2010-10-02 13:50:18


Author: viboes
Date: 2010-10-02 13:50:17 EDT (Sat, 02 Oct 2010)
New Revision: 65727
URL: http://svn.boost.org/trac/boost/changeset/65727

Log:
Opaque:
* Add more meta-mixins for binary operators
* Cleanup

Text files modified:
   sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp | 55 -----------------
   sandbox/opaque/boost/opaque/meta_mixin/operators.hpp | 126 ++++++++++++++++++++++++---------------
   2 files changed, 76 insertions(+), 105 deletions(-)

Modified: sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp (original)
+++ sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp 2010-10-02 13:50:17 EDT (Sat, 02 Oct 2010)
@@ -17,7 +17,6 @@
 #include <boost/opaque/meta_mixin/operators.hpp>
 
 namespace boost {
-
 namespace opaque {
 
 #define BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool) \
@@ -32,11 +31,6 @@
         };
     };
 
- //~ template <typename Final, typename Base, typename Bool=bool>
- //~ struct equality_comparable1 : Base {
- //~ BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool)
- //~ };
-
 #define BOOST_OPAQUE_LESS_THAN_COMPARABLE1(Final,Bool) \
         BOOST_OPAQUE_USING_LESS_THAN(Final,Bool) \
         BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool) \
@@ -51,11 +45,6 @@
         };
     };
 
- //~ template <typename Final, typename Base, typename Bool=bool>
- //~ struct less_than_comparable1 : Base {
- //~ BOOST_OPAQUE_LESS_THAN_COMPARABLE1(Final,Bool)
- //~ };
-
 
 #define BOOST_OPAQUE_ADDABLE1(Final) \
         BOOST_OPAQUE_USING_PLUS_ASSIGN(Final) \
@@ -69,11 +58,6 @@
     };
 
 
- //~ template <typename Final, typename Base>
- //~ struct addable1 : Base {
- //~ BOOST_OPAQUE_ADDABLE1(Final)
- //~ };
-
 #define BOOST_OPAQUE_SUBTRACTABLE1(Final) \
         BOOST_OPAQUE_USING_MINUS_ASSIGN(Final) \
         BOOST_OPAQUE_USING_MINUS(Final)
@@ -86,13 +70,6 @@
     };
 
 
- //~ template <typename Final, typename Base>
- //~ struct subtractable1 : Base
- //~ {
- //~ BOOST_OPAQUE_SUBTRACTABLE1(Final)
- //~ };
-
-
 #define BOOST_OPAQUE_MULTIPLIABLE1(Final) \
         BOOST_OPAQUE_USING_MULTIPLY_ASSIGN(Final) \
         BOOST_OPAQUE_USING_MULTIPLY(Final)
@@ -104,10 +81,6 @@
         };
     };
 
- //~ template <typename Final, typename Base>
- //~ struct multipliable1 : Base {
- //~ BOOST_OPAQUE_MULTIPLIABLE1(Final)
- //~ };
 
 #define BOOST_OPAQUE_DIVIDABLE1(Final) \
         BOOST_OPAQUE_USING_DIVIDE_ASSIGN(Final) \
@@ -120,12 +93,6 @@
         };
     };
 
- //~ template <typename Final, typename Base>
- //~ struct dividable1 : Base
- //~ {
- //~ BOOST_OPAQUE_DIVIDABLE1(Final)
- //~ };
-
 #define BOOST_OPAQUE_MODABLE1(Final) \
         BOOST_OPAQUE_USING_MODULUS_ASSIGN(Final) \
         BOOST_OPAQUE_USING_MODULUS(Final)
@@ -148,11 +115,6 @@
         };
     };
 
- //~ template <typename Final, typename Base>
- //~ struct bitwise_xorable1 : Base {
- //~ BOOST_OPAQUE_BITWISE_XORABLE1(Final)
- //~ };
-
 #define BOOST_OPAQUE_BITWISE_ANDABLE1(Final) \
         BOOST_OPAQUE_USING_BITWISE_AND_ASSIGN(Final) \
         BOOST_OPAQUE_USING_BITWISE_AND(Final)
@@ -164,11 +126,6 @@
         };
     };
 
- //~ template <typename Final, typename Base>
- //~ struct bitwise_andable1 : Base {
- //~ BOOST_OPAQUE_BITWISE_ANDABLE1(Final)
- //~ };
-
 #define BOOST_OPAQUE_BITWISE_ORABLE1(Final) \
         BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final) \
         BOOST_OPAQUE_USING_BITWISE_OR(Final)
@@ -180,18 +137,10 @@
         };
     };
 
- //~ template <typename Final, typename Base>
- //~ struct bitwise_orable1 : Base {
- //~ BOOST_OPAQUE_BITWISE_ORABLE1(Final)
- //~ };
-
 #define BOOST_OPAQUE_INCREMENTABLE(Final) \
         BOOST_OPAQUE_USING_PRE_INCREMENT(Final) \
         BOOST_OPAQUE_USING_POST_INCREMENT(Final)
 
- //~ template <typename Final, typename Base>
- //~ struct incrementable : boost::incrementable<Final, ope::pre_increment<Final, Base> > {};
-
     struct using_incrementable {
         template <typename Final, typename Base>
         struct type : Base
@@ -204,9 +153,6 @@
         BOOST_OPAQUE_USING_PRE_DECREMENT(Final) \
         BOOST_OPAQUE_USING_POST_DECREMENT(Final)
 
- //~ template <typename Final, typename Base>
- //~ struct decrementable : boost::decrementable<Final, ope::pre_decrement<Final, Base> > {};
-
     struct using_decrementable {
         template <typename Final, typename Base>
         struct type : Base
@@ -276,7 +222,6 @@
         BOOST_OPAQUE_ADDABLE1(Final) \
         BOOST_OPAQUE_SUBTRACTABLE1(Final)
 
-
     struct using_additive1 {
         template <typename Final, typename Base>
         struct type : Base {

Modified: sandbox/opaque/boost/opaque/meta_mixin/operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/operators.hpp (original)
+++ sandbox/opaque/boost/opaque/meta_mixin/operators.hpp 2010-10-02 13:50:17 EDT (Sat, 02 Oct 2010)
@@ -16,9 +16,7 @@
 #include <boost/operators.hpp>
 
 namespace boost {
-
 namespace opaque {
-namespace ope {
 
 #define BOOST_OPAQUE_HIDING_COPY(T) \
         private: \
@@ -49,7 +47,7 @@
             }
 
     template <typename UT>
- struct using_conversion {
+ struct using_underlying_conversion {
         template <typename Final, typename Base>
         struct type: Base {
             BOOST_OPAQUE_USING_CONVERSION(Final,UT)
@@ -66,7 +64,7 @@
         };
     };
 
- struct using_conversion_safe_bool {
+ struct using_safe_bool_conversion {
         template <typename Final, typename Base>
         struct type: Base {
             typedef typename Final::underlying_type const& (Final::*unspecified_bool_type)() const;
@@ -78,8 +76,6 @@
         };
     };
 
-
-
 #define BOOST_OPAQUE_USING_LESS_THAN(Final, Bool) \
     public :\
         Bool operator<(const Final& rhs) const { \
@@ -289,10 +285,6 @@
             BOOST_OPAQUE_USING_LEFT_SHIFT_ASSIGN(Final)
         };
     };
- template <typename Final, typename Base>
- struct left_shift_assign : Base {
- BOOST_OPAQUE_USING_LEFT_SHIFT_ASSIGN(Final)
- };
 
 #define BOOST_OPAQUE_USING_RIGHT_SHIFT_ASSIGN(Final) \
     public :\
@@ -307,10 +299,7 @@
             BOOST_OPAQUE_USING_RIGHT_SHIFT_ASSIGN(Final)
         };
     };
- template <typename Final, typename Base>
- struct right_shift_assign : Base {
- BOOST_OPAQUE_USING_RIGHT_SHIFT_ASSIGN(Final)
- };
+
     // Unary operators
 
 #define BOOST_OPAQUE_USING_LOGICAL_NOT(Final) \
@@ -326,11 +315,6 @@
         };
     };
 
- template <typename Final, typename Base>
- struct logical_not : Base {
- BOOST_OPAQUE_USING_LOGICAL_NOT(Final)
- };
-
 #define BOOST_OPAQUE_USING_UNARY_PLUS(Final) \
     public :\
         Final operator+() const { \
@@ -344,11 +328,6 @@
         };
     };
 
- template <typename Final, typename Base>
- struct unary_plus : Base {
- BOOST_OPAQUE_USING_UNARY_PLUS(Final)
- };
-
 #define BOOST_OPAQUE_USING_UNARY_MINUS(Final) \
     public :\
         Final operator-() const { \
@@ -362,11 +341,6 @@
         };
     };
 
- template <typename Final, typename Base>
- struct unary_minus : Base {
- BOOST_OPAQUE_USING_UNARY_MINUS(Final)
- };
-
 #define BOOST_OPAQUE_USING_BITWISE_NOT(Final) \
     public :\
         Final operator~() const { \
@@ -379,10 +353,6 @@
             BOOST_OPAQUE_USING_BITWISE_NOT(Final)
         };
     };
- template <typename Final, typename Base>
- struct bitwise_not : Base {
- BOOST_OPAQUE_USING_BITWISE_NOT(Final)
- };
 
     //~ template <typename Final, typename Base>
     //~ struct address_of : Base {
@@ -426,10 +396,6 @@
             BOOST_OPAQUE_USING_PRE_INCREMENT(Final)
         };
     };
- template <typename Final, typename Base>
- struct pre_increment : Base {
- BOOST_OPAQUE_USING_PRE_INCREMENT(Final)
- };
 
 #define BOOST_OPAQUE_USING_PRE_DECREMENT(Final) \
     public :\
@@ -444,10 +410,6 @@
             BOOST_OPAQUE_USING_PRE_DECREMENT(Final)
         };
     };
- template <typename Final, typename Base>
- struct pre_decrement : Base {
- BOOST_OPAQUE_USING_PRE_DECREMENT(Final)
- };
 
 #define BOOST_OPAQUE_USING_POST_INCREMENT(Final) \
     public :\
@@ -463,10 +425,6 @@
             BOOST_OPAQUE_USING_POST_INCREMENT(Final)
         };
     };
- template <typename Final, typename Base>
- struct post_increment : Base {
- BOOST_OPAQUE_USING_POST_INCREMENT(Final)
- };
 
 #define BOOST_OPAQUE_USING_POST_DECREMENT(Final) \
     public :\
@@ -482,10 +440,6 @@
             BOOST_OPAQUE_USING_POST_DECREMENT(Final)
         };
     };
- template <typename Final, typename Base>
- struct post_decrement : Base {
- BOOST_OPAQUE_USING_POST_DECREMENT(Final)
- };
 
 #if 0
 // I don't know why this doesn't works :(
@@ -514,55 +468,127 @@
         }
 #endif
 
+ struct using_plus {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_PLUS(Final)
+ };
+ };
+
+ struct using_minus {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_MINUS(Final)
+ };
+ };
+
 #define BOOST_OPAQUE_USING_MULTIPLY(Final) \
     public :\
         Final operator*(const Final& rhs) const { \
             return Final(Final::underlying(this) * rhs.underlying()); \
         }
 
+ struct using_multiply {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_MULTIPLY(Final)
+ };
+ };
+
 #define BOOST_OPAQUE_USING_DIVIDE(Final) \
     public :\
         Final operator/(const Final& rhs) const { \
             return Final(Final::underlying(this) / rhs.underlying()); \
         }
 
+ struct using_divide {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_DIVIDE(Final)
+ };
+ };
+
+
 #define BOOST_OPAQUE_USING_MODULUS(Final) \
     public :\
         Final operator%(const Final& rhs) const { \
             return Final(Final::underlying(this) % rhs.underlying()); \
         }
 
+ struct using_modulus {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_MODULUS(Final)
+ };
+ };
+
+
 #define BOOST_OPAQUE_USING_BITWISE_XOR(Final) \
     public :\
         Final operator^(const Final& rhs) const { \
             return Final(Final::underlying(this) ^ rhs.underlying()); \
         }
 
+ struct using_bitwise_xor {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_BITWISE_XOR(Final)
+ };
+ };
+
+
 #define BOOST_OPAQUE_USING_BITWISE_OR(Final) \
     public :\
         Final operator|(const Final& rhs) const { \
             return Final(Final::underlying(this) | rhs.underlying()); \
         }
 
+ struct using_bitwise_or {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_BITWISE_OR(Final)
+ };
+ };
+
 #define BOOST_OPAQUE_USING_BITWISE_AND(Final) \
     public :\
         Final operator&(const Final& rhs) const { \
             return Final(Final::underlying(this) & rhs.underlying()); \
         }
 
+ struct using_bitwise_and {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_BITWISE_AND(Final)
+ };
+ };
+
 #define BOOST_OPAQUE_USING_LEFT_SHIFT1(Final) \
     public :\
         Final operator<<(const Final& rhs) const { \
             return Final(Final::underlying(this) << rhs.underlying()); \
         }
 
+ struct using_left_shift1 {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_LEFT_SHIFT1(Final)
+ };
+ };
+
 #define BOOST_OPAQUE_USING_RIGHT_SHIFT1(Final) \
     public :\
         Final operator>>(const Final& rhs) const { \
             return Final(Final::underlying(this) >> rhs.underlying()); \
         }
 
-}
+ struct using_right_shift1 {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_RIGHT_SHIFT1(Final)
+ };
+ };
+
 }
 }
 


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