|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65715 - sandbox/opaque/boost/opaque
From: vicente.botet_at_[hidden]
Date: 2010-10-01 17:50:01
Author: viboes
Date: 2010-10-01 17:50:00 EDT (Fri, 01 Oct 2010)
New Revision: 65715
URL: http://svn.boost.org/trac/boost/changeset/65715
Log:
Opaque:
* Continue defining macros so inheritance is reduced.
Text files modified:
sandbox/opaque/boost/opaque/combined_operators.hpp | 362 ++++++++++++++++++++++++---------------
sandbox/opaque/boost/opaque/operators.hpp | 70 +-----
2 files changed, 242 insertions(+), 190 deletions(-)
Modified: sandbox/opaque/boost/opaque/combined_operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/combined_operators.hpp (original)
+++ sandbox/opaque/boost/opaque/combined_operators.hpp 2010-10-01 17:50:00 EDT (Fri, 01 Oct 2010)
@@ -32,10 +32,10 @@
};
};
- template <typename Final, typename Base, typename Bool=bool>
- struct equality_comparable1 : Base {
- BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool)
- };
+ //~ 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) \
@@ -51,10 +51,10 @@
};
};
- template <typename Final, typename Base, typename Bool=bool>
- struct less_than_comparable1 : Base {
- BOOST_OPAQUE_LESS_THAN_COMPARABLE1(Final,Bool)
- };
+ //~ 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) \
@@ -69,10 +69,10 @@
};
- template <typename Final, typename Base>
- struct addable1 : Base {
- BOOST_OPAQUE_ADDABLE1(Final)
- };
+ //~ template <typename Final, typename Base>
+ //~ struct addable1 : Base {
+ //~ BOOST_OPAQUE_ADDABLE1(Final)
+ //~ };
#define BOOST_OPAQUE_SUBTRACTABLE1(Final) \
BOOST_OPAQUE_USING_MINUS_ASSIGN(Final) \
@@ -86,11 +86,11 @@
};
- template <typename Final, typename Base>
- struct subtractable1 : Base
- {
- BOOST_OPAQUE_SUBTRACTABLE1(Final)
- };
+ //~ template <typename Final, typename Base>
+ //~ struct subtractable1 : Base
+ //~ {
+ //~ BOOST_OPAQUE_SUBTRACTABLE1(Final)
+ //~ };
#define BOOST_OPAQUE_MULTIPLIABLE1(Final) \
@@ -104,10 +104,10 @@
};
};
- template <typename Final, typename Base>
- struct multipliable1 : Base {
- BOOST_OPAQUE_MULTIPLIABLE1(Final)
- };
+ //~ template <typename Final, typename Base>
+ //~ struct multipliable1 : Base {
+ //~ BOOST_OPAQUE_MULTIPLIABLE1(Final)
+ //~ };
#define BOOST_OPAQUE_DIVIDABLE1(Final) \
BOOST_OPAQUE_USING_DIVIDE_ASSIGN(Final) \
@@ -120,11 +120,11 @@
};
};
- template <typename Final, typename Base>
- struct dividable1 : Base
- {
- BOOST_OPAQUE_DIVIDABLE1(Final)
- };
+ //~ template <typename Final, typename Base>
+ //~ struct dividable1 : Base
+ //~ {
+ //~ BOOST_OPAQUE_DIVIDABLE1(Final)
+ //~ };
#define BOOST_OPAQUE_MODABLE1(Final) \
BOOST_OPAQUE_USING_MODULUS_ASSIGN(Final) \
@@ -136,64 +136,108 @@
BOOST_OPAQUE_MODABLE1(Final)
};
};
- template <typename Final, typename Base>
- struct modable1 : Base {
- BOOST_OPAQUE_MODABLE1(Final)
- };
#define BOOST_OPAQUE_BITWISE_XORABLE1(Final) \
BOOST_OPAQUE_USING_BITWISE_XOR_ASSIGN(Final) \
BOOST_OPAQUE_USING_BITWISE_XOR(Final)
- struct using_xorable1 {
+ struct using_bitwise_xorable1 {
template <typename Final, typename UT, typename Base>
struct type : Base {
BOOST_OPAQUE_BITWISE_XORABLE1(Final)
};
};
- template <typename Final, typename Base>
- struct xorable1 : boost::xorable1<Final, ope::bitwise_xor_assign<Final, Base> > {};
+ //~ 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)
- struct using_andable1 {
+ struct using_bitwise_andable1 {
template <typename Final, typename UT, typename Base>
struct type : Base {
BOOST_OPAQUE_BITWISE_ANDABLE1(Final)
};
};
- template <typename Final, typename Base>
- struct andable1 : boost::andable1<Final, ope::bitwise_and_assign<Final, Base> > {};
+ //~ 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)
- struct using_orable1 {
+ struct using_bitwise_orable1 {
template <typename Final, typename UT, typename Base>
struct type : Base {
BOOST_OPAQUE_BITWISE_ORABLE1(Final)
};
};
- template <typename Final, typename Base>
- struct orable1 : boost::orable1<Final, ope::bitwise_or_assign<Final, Base> > {};
+ //~ template <typename Final, typename Base>
+ //~ struct bitwise_orable1 : Base {
+ //~ BOOST_OPAQUE_BITWISE_ORABLE1(Final)
+ //~ };
- template <typename Final, typename Base>
- struct incrementable : boost::incrementable<Final, ope::pre_increment<Final, Base> > {};
+#define BOOST_OPAQUE_INCREMENTABLE(Final) \
+ BOOST_OPAQUE_USING_PRE_INCREMENT(Final) \
+ BOOST_OPAQUE_USING_POST_INCREMENT(Final)
- template <typename Final, typename Base>
- struct decrementable : boost::decrementable<Final, ope::pre_decrement<Final, Base> > {};
+ //~ template <typename Final, typename Base>
+ //~ struct incrementable : boost::incrementable<Final, ope::pre_increment<Final, Base> > {};
- template <typename Final, typename Base>
- struct left_shiftable1 : boost::left_shiftable1<Final, ope::left_shift_assign<Final, Base> > {};
+ struct using_incrementable {
+ template <typename Final, typename UT, typename Base>
+ struct type : Base
+ {
+ BOOST_OPAQUE_INCREMENTABLE(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_DECREMENTABLE(Final) \
+ BOOST_OPAQUE_USING_PRE_DECREMENT(Final) \
+ BOOST_OPAQUE_USING_POST_DECREMENT(Final)
- template <typename Final, typename Base>
- struct right_shiftable1 : boost::right_shiftable1<Final, ope::right_shift_assign<Final, Base> > {};
+ //~ template <typename Final, typename Base>
+ //~ struct decrementable : boost::decrementable<Final, ope::pre_decrement<Final, Base> > {};
+
+ struct using_decrementable {
+ template <typename Final, typename UT, typename Base>
+ struct type : Base
+ {
+ BOOST_OPAQUE_DECREMENTABLE(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_LEFT_SHIFTABLE1(Final) \
+ BOOST_OPAQUE_USING_LEFT_SHIFT_ASSIGN(Final) \
+ BOOST_OPAQUE_USING_LEFT_SHIFT1(Final)
+
+ struct using_left_shiftable1 {
+ template <typename Final, typename UT, typename Base>
+ struct type : Base
+ {
+ BOOST_OPAQUE_LEFT_SHIFTABLE1(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_RIGHT_SHIFTABLE1(Final) \
+ BOOST_OPAQUE_USING_RIGHT_SHIFT_ASSIGN(Final) \
+ BOOST_OPAQUE_USING_RIGHT_SHIFT1(Final)
+
+ struct using_right_shiftable1 {
+ template <typename Final, typename UT, typename Base>
+ struct type : Base
+ {
+ BOOST_OPAQUE_RIGHT_SHIFTABLE1(Final)
+ };
+ };
#define BOOST_OPAQUE_PARTIALLY_ORDERED1(Final,Bool) \
BOOST_OPAQUE_USING_LESS_THAN(Final,Bool) \
@@ -204,13 +248,11 @@
template <typename Bool=bool>
struct using_partially_ordered1 {
template <typename Final, typename UT, typename Base>
- struct type : Base {
- BOOST_OPAQUE_PARTIALLY_ORDERED1(Final,Bool)
+ struct type : boost::partially_ordered1<Final, Base > {
+ BOOST_OPAQUE_USING_LESS_THAN(Final,Bool)
};
};
- template <typename Final, typename Base>
- struct partially_ordered1 : boost::partially_ordered1<Final, ope::less_than<Final, Base> > {};
#define BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool) \
BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool) \
@@ -224,12 +266,6 @@
};
};
- template <class Final, class Base, typename Bool=bool >
- struct totally_ordered1 : Base
- {
- BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool)
- };
-
//~ template <class T, class U, class Base = base_new_type >
//~ struct additive2
//~ : opaque::addable2<T, U
@@ -248,12 +284,6 @@
};
};
- template <class Final, class Base = base_new_type >
- struct additive1 : Base
- {
- BOOST_OPAQUE_ADDITIVE1(Final)
- };
-
//~ template <class T, class U, class Base = base_new_type >
//~ struct multiplicative2
//~ : opaque::multipliable2<T, U
@@ -272,12 +302,6 @@
};
};
- template <class Final, class Base = base_new_type >
- struct multiplicative1 : Base
- {
- BOOST_OPAQUE_MULTIPLICATIVE1(Final)
- };
-
//~ template <class T, class U, class Base = base_new_type >
//~ struct integer_multiplicative2
//~ : opaque::multiplicative2<T, U
@@ -285,14 +309,17 @@
//~ > > {};
#define BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final) \
- BOOST_OPAQUE_MULTIPLIABLE1(Final) \
+ BOOST_OPAQUE_MULTIPLICATIVE1(Final) \
BOOST_OPAQUE_MODABLE1(Final)
- template <class T, class Base = base_new_type >
struct integer_multiplicative1
- : opaque::multiplicative1<T
- , opaque::modable1<T, Base
- > > {};
+ {
+ template <class Final, class UT, class Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct arithmetic2
@@ -300,11 +327,19 @@
//~ , opaque::multiplicative2<T, U, Base
//~ > > {};
- template <class Final, class Base = base_new_type >
- struct arithmetic1
- : opaque::additive1<Final
- , opaque::multiplicative1<Final, Base
- > > {};
+ #define BOOST_OPAQUE_ARITHMETIC1(Final) \
+ BOOST_OPAQUE_ADDITIVE1(Final) \
+ BOOST_OPAQUE_MULTIPLICATIVE1(Final)
+
+
+ struct using_arithmetic1
+ {
+ template <class Final, class UT, class Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_ARITHMETIC1(Final)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct integer_arithmetic2
@@ -312,11 +347,18 @@
//~ , integer_multiplicative2<T, U, Base
//~ > > {};
- template <class T, class Base = base_new_type >
- struct integer_arithmetic1
- : opaque::additive1<T
- , opaque::integer_multiplicative1<T, Base
- > > {};
+ #define BOOST_OPAQUE_INTEGER_ARITHMETIC1(Final) \
+ BOOST_OPAQUE_ADDITIVE1(Final) \
+ BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final)
+
+ struct using_integer_arithmetic1
+ {
+ template <class Final, class UT, class Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_INTEGER_ARITHMETIC1(Final)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct bitwise2
@@ -325,18 +367,32 @@
//~ , opaque::orable2<T, U, Base
//~ > > > {};
- template <class T, class Base = base_new_type >
- struct bitwise1
- : opaque::xorable1<T
- , opaque::andable1<T
- , opaque::orable1<T, Base
- > > > {};
-
- template <class T, class Base = base_new_type >
- struct unit_steppable
- : opaque::incrementable<T
- , opaque::decrementable<T, Base
- > > {};
+ #define BOOST_OPAQUE_BITWISE1(Final) \
+ BOOST_OPAQUE_BITWISE_XORABLE1(Final) \
+ BOOST_OPAQUE_BITWISE_ANDABLE1(Final) \
+ BOOST_OPAQUE_BITWISE_ORABLE1(Final)
+
+ struct using_bitwise1
+ {
+ template <class Final, class UT, class Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_BITWISE1(Final)
+ };
+ };
+
+ #define BOOST_OPAQUE_UNIT_STEPABLE(Final) \
+ BOOST_OPAQUE_INCREMENTABLE(Final) \
+ BOOST_OPAQUE_DECREMENTABLE(Final)
+
+ struct using_unit_steppable
+ {
+ template <class Final, class UT, class Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_UNIT_STEPABLE(Final)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct shiftable2
@@ -344,11 +400,18 @@
//~ , opaque::right_shiftable2<T, U, Base
//~ > > {};
- template <class T, class Base = base_new_type >
- struct shiftable1
- : opaque::left_shiftable1<T
- , opaque::right_shiftable1<T, Base
- > > {};
+ #define BOOST_OPAQUE_SHIFTABLE1(Final) \
+ BOOST_OPAQUE_LEFT_SHIFTABLE1(Final) \
+ BOOST_OPAQUE_RIGHT_SHIFTABLE1(Final)
+
+ struct using_shiftable1
+ {
+ template <class Final, class UT, class Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_SHIFTABLE1(Final)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct ring_operators2
@@ -357,11 +420,18 @@
//~ , opaque::multipliable2<T, U, Base
//~ > > > {};
- template <class T, class Base = base_new_type >
- struct ring_operators1
- : opaque::additive1<T
- , opaque::multipliable1<T, Base
- > > {};
+ #define BOOST_OPAQUE_RING1(Final) \
+ BOOST_OPAQUE_ADDITIVE1(Final) \
+ BOOST_OPAQUE_MULTIPLICATIVE1(Final)
+
+ struct using_ring_operators1
+ {
+ template <class Final, class UT, class Base = base_new_type >
+ struct type: Base
+ {
+ BOOST_OPAQUE_RING1(Final)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct ordered_ring_operators2
@@ -369,11 +439,19 @@
//~ , opaque::totally_ordered2<T, U, Base
//~ > > {};
- template <class T, class UT, class Base = base_new_type >
- struct ordered_ring_operators1
- : opaque::ring_operators1<T
- , opaque::totally_ordered1<T, Base
- > > {};
+ #define BOOST_OPAQUE_ORDERED_RING1(Final, Bool) \
+ BOOST_OPAQUE_RING1(Final) \
+ BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool)
+
+ template <typename Bool=bool>
+ struct using_ordered_ring_operators1
+ {
+ template <class Final, class UT, class Base = base_new_type>
+ struct type : Base
+ {
+ BOOST_OPAQUE_ORDERED_RING1(Final,Bool)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct field_operators2
@@ -382,11 +460,18 @@
//~ , opaque::dividable2_left<T, U, Base
//~ > > > {};
- template <class T, class Base = base_new_type >
- struct field_operators1
- : opaque::ring_operators1<T
- , opaque::dividable1<T, Base
- > > {};
+ #define BOOST_OPAQUE_FIELD1(Final) \
+ BOOST_OPAQUE_RING1(Final) \
+ BOOST_OPAQUE_DIVIDABLE1(Final)
+
+ struct using_field_operators1
+ {
+ template <class Final, class Base = base_new_type>
+ struct type: Base
+ {
+ BOOST_OPAQUE_FIELD1(Final)
+ };
+ };
//~ template <class T, class U, class Base = base_new_type >
//~ struct ordered_field_operators2
@@ -394,33 +479,34 @@
//~ , opaque::totally_ordered2<T, U, Base
//~ > > {};
- template <class T, class UT, class Base = base_new_type >
- struct ordered_field_operators1
- : opaque::field_operators1<T
- , opaque::totally_ordered1<T, Base
- > > {};
+ #define BOOST_OPAQUE_ORDERED_FIELD1(Final, Bool) \
+ BOOST_OPAQUE_FIELD1(Final) \
+ BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool)
+ template <typename Bool=bool>
+ struct using_ordered_field_operators1
+ {
+ template <class Final, class UT, class Base = base_new_type>
+ struct type : Base
+ {
+ BOOST_OPAQUE_ORDERED_FIELD1(Final,Bool)
+ };
+ };
}
- template <typename T>
+ template <typename T, typename Bool=bool>
struct inherited_from_undelying {
- template <typename Final, typename UT, typename Base>
- struct type :
- opaque::totally_ordered1< Final
- , opaque::integer_arithmetic1< Final
- , boost::bitwise1< Final
- , opaque::unit_steppable< Final
- , opaque::ope::unary_plus< Final
- , opaque::ope::unary_minus< Final
- , Base
- >
- >
- >
- >
- >
- >
- {};
+ template <typename Final, typename UT, typename Base>
+ struct type : Base
+ {
+ BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool)
+ BOOST_OPAQUE_INTEGER_ARITHMETIC1(Final)
+ BOOST_OPAQUE_BITWISE1(Final)
+ BOOST_OPAQUE_UNIT_STEPABLE(Final)
+ BOOST_OPAQUE_USING_UNARY_PLUS(Final)
+ BOOST_OPAQUE_USING_UNARY_MINUS(Final)
+ };
};
}
Modified: sandbox/opaque/boost/opaque/operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/operators.hpp (original)
+++ sandbox/opaque/boost/opaque/operators.hpp 2010-10-01 17:50:00 EDT (Fri, 01 Oct 2010)
@@ -84,11 +84,6 @@
return Bool(Final::underlying(this) < rhs.underlying());\
}
- template <typename Final, typename Base, typename Bool=bool>
- struct less_than : Base {
- BOOST_OPAQUE_USING_LESS_THAN(Final, Bool)
- };
-
template <typename Bool=bool>
struct using_less_than {
template <typename Final, typename UT, typename Base>
@@ -145,10 +140,6 @@
return Bool(Final::underlying(this) == rhs.underlying());\
}
- template <typename Final, typename Base, typename Bool=bool>
- struct equal : Base {
- BOOST_OPAQUE_USING_EQUAL(Final,Bool)
- };
template <typename Bool=bool>
struct using_equal {
template <typename Final, typename UT, typename Base>
@@ -163,11 +154,6 @@
return Bool(Final::underlying(this) != rhs.underlying());\
}
-
- template <typename Final, typename Base, typename Bool=bool>
- struct not_equal : Base {
- BOOST_OPAQUE_USING_NOT_EQUAL(Final,Bool)
- };
template <typename Bool=bool>
struct using_not_equal {
template <typename Final, typename UT, typename Base>
@@ -183,10 +169,6 @@
return Final::final(this); \
}
- template <typename Final, typename Base>
- struct plus_assign : Base {
- BOOST_OPAQUE_USING_PLUS_ASSIGN(Final)
- };
struct using_plus_assign {
template <typename Final, typename UT, typename Base>
struct type: Base {
@@ -201,10 +183,6 @@
return Final::final(this); \
}
- template <typename Final, typename Base>
- struct minus_assign : Base {
- BOOST_OPAQUE_USING_MINUS_ASSIGN(Final)
- };
struct using_minus_assign {
template <typename Final, typename UT, typename Base>
struct type: Base {
@@ -219,10 +197,6 @@
return Final::final(this); \
}
- template <typename Final, typename Base>
- struct multiply_assign : Base {
- BOOST_OPAQUE_USING_MULTIPLY_ASSIGN(Final)
- };
struct using_multiply_assign {
template <typename Final, typename UT, typename Base>
struct type: Base {
@@ -237,10 +211,6 @@
return Final::final(this); \
}
- template <typename Final, typename Base>
- struct divide_assign : Base {
- BOOST_OPAQUE_USING_DIVIDE_ASSIGN(Final)
- };
struct using_divide_assign {
template <typename Final, typename UT, typename Base>
struct type: Base {
@@ -255,10 +225,6 @@
return Final::final(this); \
}
- template <typename Final, typename Base>
- struct modulus_assign : Base {
- BOOST_OPAQUE_USING_MODULUS_ASSIGN(Final)
- };
struct using_modulus_assign {
template <typename Final, typename UT, typename Base>
struct type: Base {
@@ -273,10 +239,6 @@
return Final::final(this); \
}
- template <typename Final, typename Base>
- struct bitwise_xor_assign : Base {
- BOOST_OPAQUE_USING_BITWISE_XOR_ASSIGN(Final)
- };
struct using_bitwise_xor_assign {
template <typename Final, typename UT, typename Base>
struct type: Base {
@@ -297,10 +259,6 @@
BOOST_OPAQUE_USING_BITWISE_AND_ASSIGN(Final)
};
};
- template <typename Final, typename Base>
- struct bitwise_and_assign : Base {
- BOOST_OPAQUE_USING_BITWISE_AND_ASSIGN(Final)
- };
#define BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final) \
public :\
@@ -315,10 +273,6 @@
BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final)
};
};
- template <typename Final, typename Base>
- struct bitwise_or_assign : Base {
- BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final)
- };
#define BOOST_OPAQUE_USING_LEFT_SHIFT_ASSIGN(Final) \
public :\
@@ -459,7 +413,7 @@
// Increment and decrement
#define BOOST_OPAQUE_USING_PRE_INCREMENT(Final) \
public :\
- Final& operator++() { \
+ Final operator++() { \
++Final::underlying(this); \
return Final::final(this); \
}
@@ -477,7 +431,7 @@
#define BOOST_OPAQUE_USING_PRE_DECREMENT(Final) \
public :\
- Final& operator--() { \
+ Final operator--() { \
--Final::underlying(this); \
return Final::final(this); \
}
@@ -495,8 +449,8 @@
#define BOOST_OPAQUE_USING_POST_INCREMENT(Final) \
public :\
- Final& operator--() { \
- typename Final::underlying_type nrv(*this); \
+ Final operator++(int) { \
+ Final nrv(Final::final(this)); \
Final::underlying(this)++; \
return nrv; \
}
@@ -514,8 +468,8 @@
#define BOOST_OPAQUE_USING_POST_DECREMENT(Final) \
public :\
- Final& operator--() { \
- typename Final::underlying_type nrv(*this); \
+ Final operator--(int) { \
+ Final nrv(Final::final(this)); \
Final::underlying(this)--; \
return nrv; \
}
@@ -594,6 +548,18 @@
return Final(Final::underlying(this) & rhs.underlying()); \
}
+#define BOOST_OPAQUE_USING_LEFT_SHIFT1(Final) \
+ public :\
+ Final operator<<(const Final& rhs) const { \
+ return Final(Final::underlying(this) << rhs.underlying()); \
+ }
+
+#define BOOST_OPAQUE_USING_RIGHT_SHIFT1(Final) \
+ public :\
+ Final operator>>(const Final& rhs) const { \
+ return Final(Final::underlying(this) >> rhs.underlying()); \
+ }
+
}
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