|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65726 - in sandbox/opaque/boost/opaque: . meta_mixin
From: vicente.botet_at_[hidden]
Date: 2010-10-02 13:35:53
Author: viboes
Date: 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
New Revision: 65726
URL: http://svn.boost.org/trac/boost/changeset/65726
Log:
Opaque:
* Move meta-mixins to meta_mixin directory
Added:
sandbox/opaque/boost/opaque/meta_mixin/
sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp (contents, props changed)
sandbox/opaque/boost/opaque/meta_mixin/linear_hierarchy.hpp (contents, props changed)
sandbox/opaque/boost/opaque/meta_mixin/operators.hpp (contents, props changed)
sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp (contents, props changed)
sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp (contents, props changed)
Removed:
sandbox/opaque/boost/opaque/combined_operators.hpp
sandbox/opaque/boost/opaque/linear_hierarchy.hpp
sandbox/opaque/boost/opaque/operators.hpp
sandbox/opaque/boost/opaque/transitive_explicit_substituable.hpp
sandbox/opaque/boost/opaque/transitive_substituable.hpp
Text files modified:
sandbox/opaque/boost/opaque/new_class.hpp | 2 +-
sandbox/opaque/boost/opaque/opaque.hpp | 4 ++--
sandbox/opaque/boost/opaque/opaque_type.hpp | 2 +-
sandbox/opaque/boost/opaque/private_opaque_class.hpp | 4 ++--
sandbox/opaque/boost/opaque/private_opaque_type.hpp | 2 +-
sandbox/opaque/boost/opaque/public_opaque_class.hpp | 4 ++--
sandbox/opaque/boost/opaque/public_opaque_type.hpp | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
Deleted: sandbox/opaque/boost/opaque/combined_operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/combined_operators.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
+++ (empty file)
@@ -1,512 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_COMBINED_OPERATORS_HPP
-#define BOOST_OPAQUE_COMBINED_OPERATORS_HPP
-
-#include <boost/operators.hpp>
-#include <boost/opaque/operators.hpp>
-
-namespace boost {
-
-namespace opaque {
-
-#define BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool) \
- BOOST_OPAQUE_USING_EQUAL(Final,Bool) \
- BOOST_OPAQUE_USING_NOT_EQUAL(Final,Bool)
-
- template <typename Bool=bool>
- struct using_equality_comparable1 {
- template <typename Final, typename Base>
- struct type : 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) \
- BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool) \
- BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool) \
- BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool)
-
- template <typename Bool=bool>
- struct using_less_than_comparable1 {
- template <typename Final, typename Base>
- struct type : 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) \
- BOOST_OPAQUE_USING_PLUS_ASSIGN(Final) \
- BOOST_OPAQUE_USING_PLUS(Final)
-
- struct using_addable1 {
- template <typename Final, typename Base>
- struct type : 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) \
- BOOST_OPAQUE_USING_MINUS(Final)
-
- struct using_subtractable1 {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_SUBTRACTABLE1(Final)
- };
- };
-
-
- //~ 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)
-
- struct using_multipliable1 {
- template <typename Final, typename Base>
- struct type : 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) \
- BOOST_OPAQUE_USING_DIVIDE(Final)
-
- struct using_dividable1 {
- template <typename Final, typename Base>
- struct type : 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) \
- BOOST_OPAQUE_USING_MODULUS(Final)
-
- struct using_modable1 {
- template <typename Final, typename Base>
- struct type : 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_bitwise_xorable1 {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_BITWISE_XORABLE1(Final)
- };
- };
-
- //~ 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_bitwise_andable1 {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_BITWISE_ANDABLE1(Final)
- };
- };
-
- //~ 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_bitwise_orable1 {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_BITWISE_ORABLE1(Final)
- };
- };
-
- //~ 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
- {
- 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 decrementable : boost::decrementable<Final, ope::pre_decrement<Final, Base> > {};
-
- struct using_decrementable {
- template <typename Final, 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 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 Base>
- struct type : Base
- {
- BOOST_OPAQUE_RIGHT_SHIFTABLE1(Final)
- };
- };
-
-#define BOOST_OPAQUE_PARTIALLY_ORDERED1(Final,Bool) \
- BOOST_OPAQUE_USING_LESS_THAN(Final,Bool) \
- BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool) \
- BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool) \
- BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool)
-
- template <typename Bool=bool>
- struct using_partially_ordered1 {
- template <typename Final, typename Base>
- struct type : boost::partially_ordered1<Final, Base > {
- BOOST_OPAQUE_USING_LESS_THAN(Final,Bool)
- };
- };
-
-
-#define BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool) \
- BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool) \
- BOOST_OPAQUE_LESS_THAN_COMPARABLE1(Final,Bool)
-
- template <typename Bool=bool>
- struct using_totally_ordered1 {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct additive2
- //~ : opaque::addable2<T, U
- //~ , opaque::subtractable2<T, U, Base
- //~ > > {};
-
- #define BOOST_OPAQUE_ADDITIVE1(Final) \
- BOOST_OPAQUE_ADDABLE1(Final) \
- BOOST_OPAQUE_SUBTRACTABLE1(Final)
-
-
- struct using_additive1 {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_ADDITIVE1(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct multiplicative2
- //~ : opaque::multipliable2<T, U
- //~ , opaque::dividable2<T, U, Base
- //~ > > {};
-
- #define BOOST_OPAQUE_MULTIPLICATIVE1(Final) \
- BOOST_OPAQUE_MULTIPLIABLE1(Final) \
- BOOST_OPAQUE_DIVIDABLE1(Final)
-
-
- struct using_multiplicative1 {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_MULTIPLICATIVE1(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct integer_multiplicative2
- //~ : opaque::multiplicative2<T, U
- //~ , opaque::modable2<T, U, Base
- //~ > > {};
-
- #define BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final) \
- BOOST_OPAQUE_MULTIPLICATIVE1(Final) \
- BOOST_OPAQUE_MODABLE1(Final)
-
- struct integer_multiplicative1
- {
- template <typename Final, typename Base = base_new_type >
- struct type : Base
- {
- BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct arithmetic2
- //~ : opaque::additive2<T, U
- //~ , opaque::multiplicative2<T, U, Base
- //~ > > {};
-
- #define BOOST_OPAQUE_ARITHMETIC1(Final) \
- BOOST_OPAQUE_ADDITIVE1(Final) \
- BOOST_OPAQUE_MULTIPLICATIVE1(Final)
-
-
- struct using_arithmetic1
- {
- template <typename Final, typename Base = base_new_type >
- struct type : Base
- {
- BOOST_OPAQUE_ARITHMETIC1(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct integer_arithmetic2
- //~ : additive2<T, U
- //~ , integer_multiplicative2<T, U, Base
- //~ > > {};
-
- #define BOOST_OPAQUE_INTEGER_ARITHMETIC1(Final) \
- BOOST_OPAQUE_ADDITIVE1(Final) \
- BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final)
-
- struct using_integer_arithmetic1
- {
- template <typename Final, typename Base = base_new_type >
- struct type : Base
- {
- BOOST_OPAQUE_INTEGER_ARITHMETIC1(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct bitwise2
- //~ : opaque::xorable2<T, U
- //~ , opaque::andable2<T, U
- //~ , opaque::orable2<T, U, 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 <typename Final, typename 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 <typename Final, typename Base = base_new_type >
- struct type : Base
- {
- BOOST_OPAQUE_UNIT_STEPABLE(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct shiftable2
- //~ : opaque::left_shiftable2<T, U
- //~ , opaque::right_shiftable2<T, U, Base
- //~ > > {};
-
- #define BOOST_OPAQUE_SHIFTABLE1(Final) \
- BOOST_OPAQUE_LEFT_SHIFTABLE1(Final) \
- BOOST_OPAQUE_RIGHT_SHIFTABLE1(Final)
-
- struct using_shiftable1
- {
- template <typename Final, typename Base = base_new_type >
- struct type : Base
- {
- BOOST_OPAQUE_SHIFTABLE1(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct ring_operators2
- //~ : opaque::additive2<T, U
- //~ , opaque::subtractable2_left<T, U
- //~ , opaque::multipliable2<T, U, Base
- //~ > > > {};
-
- #define BOOST_OPAQUE_RING1(Final) \
- BOOST_OPAQUE_ADDITIVE1(Final) \
- BOOST_OPAQUE_MULTIPLIABLE1(Final)
-
- struct using_ring_operators1
- {
- template <typename Final, typename Base = base_new_type >
- struct type: Base
- {
- BOOST_OPAQUE_RING1(Final)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct ordered_ring_operators2
- //~ : opaque::ring_operators2<T, U
- //~ , opaque::totally_ordered2<T, U, 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 <typename Final, typename Base = base_new_type>
- struct type : Base
- {
- BOOST_OPAQUE_ORDERED_RING1(Final,Bool)
- };
- };
-
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct field_operators2
- //~ : opaque::ring_operators2<T, U
- //~ , opaque::dividable2<T, U
- //~ , opaque::dividable2_left<T, U, Base
- //~ > > > {};
-
- #define BOOST_OPAQUE_FIELD1(Final) \
- BOOST_OPAQUE_RING1(Final) \
- BOOST_OPAQUE_DIVIDABLE1(Final)
-
- struct using_field_operators1
- {
- template <typename Final, typename Base = base_new_type>
- struct type: Base
- {
- BOOST_OPAQUE_FIELD1(Final)
- };
- };
- //~ template <class T, class U, typename Base = base_new_type >
- //~ struct ordered_field_operators2
- //~ : opaque::field_operators2<T, U
- //~ , opaque::totally_ordered2<T, U, 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 <typename Final, typename Base = base_new_type>
- struct type : Base
- {
- BOOST_OPAQUE_ORDERED_FIELD1(Final,Bool)
- };
- };
-
-}
- template <typename T, typename Bool=bool>
- struct inherited_from_undelying {
- template <typename Final, 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)
- };
- };
-}
-
-
-#endif
Deleted: sandbox/opaque/boost/opaque/linear_hierarchy.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/linear_hierarchy.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
+++ (empty file)
@@ -1,46 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_LINEAR_HIERARCHY_HPP
-#define BOOST_OPAQUE_LINEAR_HIERARCHY_HPP
-
-#include <boost/mpl/vector.hpp>
-#include <boost/mpl/fold.hpp>
-
-namespace boost {
-
- ////// implementation //////
- namespace detail{
-
- template<typename Final, typename State, typename MetaMixin>
- struct do_inhetit : MetaMixin::template type< Final, State> {
- };
-
- template<typename Final>
- struct inherit {
- template<typename State, typename MetaMixin>
- struct apply{
- typedef do_inhetit< Final, State, MetaMixin> type;
- };
- };
-
- }
-
- template<typename MetaMixinSeq, typename Final, typename Base>
- struct linear_hierarchy {
- typedef typename boost::mpl::fold<MetaMixinSeq, Base, detail::inherit<Final> >::type type;
- };
-
-}
-
-
-#endif
Added: sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp
==============================================================================
--- (empty file)
+++ sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -0,0 +1,512 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2010.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/opaque for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_OPAQUE_COMBINED_OPERATORS_HPP
+#define BOOST_OPAQUE_COMBINED_OPERATORS_HPP
+
+#include <boost/operators.hpp>
+#include <boost/opaque/meta_mixin/operators.hpp>
+
+namespace boost {
+
+namespace opaque {
+
+#define BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool) \
+ BOOST_OPAQUE_USING_EQUAL(Final,Bool) \
+ BOOST_OPAQUE_USING_NOT_EQUAL(Final,Bool)
+
+ template <typename Bool=bool>
+ struct using_equality_comparable1 {
+ template <typename Final, typename Base>
+ struct type : 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) \
+ BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool) \
+ BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool) \
+ BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool)
+
+ template <typename Bool=bool>
+ struct using_less_than_comparable1 {
+ template <typename Final, typename Base>
+ struct type : 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) \
+ BOOST_OPAQUE_USING_PLUS_ASSIGN(Final) \
+ BOOST_OPAQUE_USING_PLUS(Final)
+
+ struct using_addable1 {
+ template <typename Final, typename Base>
+ struct type : 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) \
+ BOOST_OPAQUE_USING_MINUS(Final)
+
+ struct using_subtractable1 {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_SUBTRACTABLE1(Final)
+ };
+ };
+
+
+ //~ 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)
+
+ struct using_multipliable1 {
+ template <typename Final, typename Base>
+ struct type : 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) \
+ BOOST_OPAQUE_USING_DIVIDE(Final)
+
+ struct using_dividable1 {
+ template <typename Final, typename Base>
+ struct type : 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) \
+ BOOST_OPAQUE_USING_MODULUS(Final)
+
+ struct using_modable1 {
+ template <typename Final, typename Base>
+ struct type : 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_bitwise_xorable1 {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_BITWISE_XORABLE1(Final)
+ };
+ };
+
+ //~ 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_bitwise_andable1 {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_BITWISE_ANDABLE1(Final)
+ };
+ };
+
+ //~ 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_bitwise_orable1 {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_BITWISE_ORABLE1(Final)
+ };
+ };
+
+ //~ 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
+ {
+ 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 decrementable : boost::decrementable<Final, ope::pre_decrement<Final, Base> > {};
+
+ struct using_decrementable {
+ template <typename Final, 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 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 Base>
+ struct type : Base
+ {
+ BOOST_OPAQUE_RIGHT_SHIFTABLE1(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_PARTIALLY_ORDERED1(Final,Bool) \
+ BOOST_OPAQUE_USING_LESS_THAN(Final,Bool) \
+ BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool) \
+ BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool) \
+ BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool)
+
+ template <typename Bool=bool>
+ struct using_partially_ordered1 {
+ template <typename Final, typename Base>
+ struct type : boost::partially_ordered1<Final, Base > {
+ BOOST_OPAQUE_USING_LESS_THAN(Final,Bool)
+ };
+ };
+
+
+#define BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool) \
+ BOOST_OPAQUE_EQUALITY_COMPARABLE1(Final,Bool) \
+ BOOST_OPAQUE_LESS_THAN_COMPARABLE1(Final,Bool)
+
+ template <typename Bool=bool>
+ struct using_totally_ordered1 {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_TOTALY_ORDERED1(Final,Bool)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct additive2
+ //~ : opaque::addable2<T, U
+ //~ , opaque::subtractable2<T, U, Base
+ //~ > > {};
+
+ #define BOOST_OPAQUE_ADDITIVE1(Final) \
+ BOOST_OPAQUE_ADDABLE1(Final) \
+ BOOST_OPAQUE_SUBTRACTABLE1(Final)
+
+
+ struct using_additive1 {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_ADDITIVE1(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct multiplicative2
+ //~ : opaque::multipliable2<T, U
+ //~ , opaque::dividable2<T, U, Base
+ //~ > > {};
+
+ #define BOOST_OPAQUE_MULTIPLICATIVE1(Final) \
+ BOOST_OPAQUE_MULTIPLIABLE1(Final) \
+ BOOST_OPAQUE_DIVIDABLE1(Final)
+
+
+ struct using_multiplicative1 {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_MULTIPLICATIVE1(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct integer_multiplicative2
+ //~ : opaque::multiplicative2<T, U
+ //~ , opaque::modable2<T, U, Base
+ //~ > > {};
+
+ #define BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final) \
+ BOOST_OPAQUE_MULTIPLICATIVE1(Final) \
+ BOOST_OPAQUE_MODABLE1(Final)
+
+ struct integer_multiplicative1
+ {
+ template <typename Final, typename Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct arithmetic2
+ //~ : opaque::additive2<T, U
+ //~ , opaque::multiplicative2<T, U, Base
+ //~ > > {};
+
+ #define BOOST_OPAQUE_ARITHMETIC1(Final) \
+ BOOST_OPAQUE_ADDITIVE1(Final) \
+ BOOST_OPAQUE_MULTIPLICATIVE1(Final)
+
+
+ struct using_arithmetic1
+ {
+ template <typename Final, typename Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_ARITHMETIC1(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct integer_arithmetic2
+ //~ : additive2<T, U
+ //~ , integer_multiplicative2<T, U, Base
+ //~ > > {};
+
+ #define BOOST_OPAQUE_INTEGER_ARITHMETIC1(Final) \
+ BOOST_OPAQUE_ADDITIVE1(Final) \
+ BOOST_OPAQUE_INTEGER_MULTIPLICATIVE1(Final)
+
+ struct using_integer_arithmetic1
+ {
+ template <typename Final, typename Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_INTEGER_ARITHMETIC1(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct bitwise2
+ //~ : opaque::xorable2<T, U
+ //~ , opaque::andable2<T, U
+ //~ , opaque::orable2<T, U, 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 <typename Final, typename 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 <typename Final, typename Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_UNIT_STEPABLE(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct shiftable2
+ //~ : opaque::left_shiftable2<T, U
+ //~ , opaque::right_shiftable2<T, U, Base
+ //~ > > {};
+
+ #define BOOST_OPAQUE_SHIFTABLE1(Final) \
+ BOOST_OPAQUE_LEFT_SHIFTABLE1(Final) \
+ BOOST_OPAQUE_RIGHT_SHIFTABLE1(Final)
+
+ struct using_shiftable1
+ {
+ template <typename Final, typename Base = base_new_type >
+ struct type : Base
+ {
+ BOOST_OPAQUE_SHIFTABLE1(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct ring_operators2
+ //~ : opaque::additive2<T, U
+ //~ , opaque::subtractable2_left<T, U
+ //~ , opaque::multipliable2<T, U, Base
+ //~ > > > {};
+
+ #define BOOST_OPAQUE_RING1(Final) \
+ BOOST_OPAQUE_ADDITIVE1(Final) \
+ BOOST_OPAQUE_MULTIPLIABLE1(Final)
+
+ struct using_ring_operators1
+ {
+ template <typename Final, typename Base = base_new_type >
+ struct type: Base
+ {
+ BOOST_OPAQUE_RING1(Final)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct ordered_ring_operators2
+ //~ : opaque::ring_operators2<T, U
+ //~ , opaque::totally_ordered2<T, U, 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 <typename Final, typename Base = base_new_type>
+ struct type : Base
+ {
+ BOOST_OPAQUE_ORDERED_RING1(Final,Bool)
+ };
+ };
+
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct field_operators2
+ //~ : opaque::ring_operators2<T, U
+ //~ , opaque::dividable2<T, U
+ //~ , opaque::dividable2_left<T, U, Base
+ //~ > > > {};
+
+ #define BOOST_OPAQUE_FIELD1(Final) \
+ BOOST_OPAQUE_RING1(Final) \
+ BOOST_OPAQUE_DIVIDABLE1(Final)
+
+ struct using_field_operators1
+ {
+ template <typename Final, typename Base = base_new_type>
+ struct type: Base
+ {
+ BOOST_OPAQUE_FIELD1(Final)
+ };
+ };
+ //~ template <class T, class U, typename Base = base_new_type >
+ //~ struct ordered_field_operators2
+ //~ : opaque::field_operators2<T, U
+ //~ , opaque::totally_ordered2<T, U, 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 <typename Final, typename Base = base_new_type>
+ struct type : Base
+ {
+ BOOST_OPAQUE_ORDERED_FIELD1(Final,Bool)
+ };
+ };
+
+}
+ template <typename T, typename Bool=bool>
+ struct inherited_from_undelying {
+ template <typename Final, 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)
+ };
+ };
+}
+
+
+#endif
Added: sandbox/opaque/boost/opaque/meta_mixin/linear_hierarchy.hpp
==============================================================================
--- (empty file)
+++ sandbox/opaque/boost/opaque/meta_mixin/linear_hierarchy.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2010.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/opaque for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_OPAQUE_LINEAR_HIERARCHY_HPP
+#define BOOST_OPAQUE_LINEAR_HIERARCHY_HPP
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/fold.hpp>
+
+namespace boost {
+
+ ////// implementation //////
+ namespace detail{
+
+ template<typename Final, typename State, typename MetaMixin>
+ struct do_inhetit : MetaMixin::template type< Final, State> {
+ };
+
+ template<typename Final>
+ struct inherit {
+ template<typename State, typename MetaMixin>
+ struct apply{
+ typedef do_inhetit< Final, State, MetaMixin> type;
+ };
+ };
+
+ }
+
+ template<typename MetaMixinSeq, typename Final, typename Base>
+ struct linear_hierarchy {
+ typedef typename boost::mpl::fold<MetaMixinSeq, Base, detail::inherit<Final> >::type type;
+ };
+
+}
+
+
+#endif
Added: sandbox/opaque/boost/opaque/meta_mixin/operators.hpp
==============================================================================
--- (empty file)
+++ sandbox/opaque/boost/opaque/meta_mixin/operators.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -0,0 +1,570 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2010.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/opaque for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_OPAQUE_OPERATORS_HPP
+#define BOOST_OPAQUE_OPERATORS_HPP
+
+#include <boost/operators.hpp>
+
+namespace boost {
+
+namespace opaque {
+namespace ope {
+
+#define BOOST_OPAQUE_HIDING_COPY(T) \
+ private: \
+ T( const T& );
+
+ struct hiding_copy {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_HIDING_COPY(type)
+ };
+ };
+
+#define BOOST_OPAQUE_HIDING_ASSIGN(T) \
+ private: \
+ T& operator=(T const&);
+
+ struct hiding_assign {
+ template <typename Final, typename Base>
+ struct type : Base {
+ BOOST_OPAQUE_HIDING_ASSIGN(type)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_CONVERSION(Final,UT) \
+ public: \
+ operator UT() const{ \
+ return Final::underlying(this); \
+ }
+
+ template <typename UT>
+ struct using_conversion {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_CONVERSION(Final,UT)
+ };
+ };
+
+ template <typename T>
+ struct using_conversion_to {
+ template <typename Final, typename Base>
+ struct type: Base {
+ operator T() const{
+ return T(Final::underlying(this));
+ }
+ };
+ };
+
+ struct using_conversion_safe_bool {
+ template <typename Final, typename Base>
+ struct type: Base {
+ typedef typename Final::underlying_type const& (Final::*unspecified_bool_type)() const;
+
+ operator unspecified_bool_type() const
+ {
+ return Final::underlying(this) ? &Final::underlying : 0;
+ }
+ };
+ };
+
+
+
+#define BOOST_OPAQUE_USING_LESS_THAN(Final, Bool) \
+ public :\
+ Bool operator<(const Final& rhs) const { \
+ return Bool(Final::underlying(this) < rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_less_than {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_LESS_THAN(Final,Bool)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool) \
+ public :\
+ Bool operator<=(const Final& rhs) const { \
+ return Bool(Final::underlying(this) <= rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_less_than_equal {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool) \
+ public :\
+ Bool operator>(const Final& rhs) const { \
+ return Bool(Final::underlying(this) > rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_greater_than {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool) \
+ public :\
+ Bool operator>=(const Final& rhs) const { \
+ return Bool(Final::underlying(this) >= rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_greater_than_equal {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_EQUAL(Final,Bool) \
+ public :\
+ Bool operator==(const Final& rhs) const { \
+ return Bool(Final::underlying(this) == rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_equal {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_EQUAL(Final,Bool)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_NOT_EQUAL(Final,Bool) \
+ public :\
+ Bool operator!=(const Final& rhs) const { \
+ return Bool(Final::underlying(this) != rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_not_equal {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_NOT_EQUAL(Final,Bool)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_PLUS_ASSIGN(Final) \
+ public :\
+ Final& operator+=(const Final& rhs) { \
+ Final::underlying(this) += rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_plus_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_PLUS_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_MINUS_ASSIGN(Final) \
+ public :\
+ Final& operator-=(const Final& rhs) { \
+ Final::underlying(this) -= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_minus_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_MINUS_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_MULTIPLY_ASSIGN(Final) \
+ public :\
+ Final& operator*=(const Final& rhs) { \
+ Final::underlying(this) *= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_multiply_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_MULTIPLY_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_DIVIDE_ASSIGN(Final) \
+ public :\
+ Final& operator/=(const Final& rhs) { \
+ Final::underlying(this) /= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_divide_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_DIVIDE_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_MODULUS_ASSIGN(Final) \
+ public :\
+ Final& operator%=(const Final& rhs) { \
+ Final::underlying(this) %= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_modulus_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_MODULUS_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_BITWISE_XOR_ASSIGN(Final) \
+ public :\
+ Final& operator^=(const Final& rhs) { \
+ Final::underlying(this) ^= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_bitwise_xor_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_BITWISE_XOR_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_BITWISE_AND_ASSIGN(Final) \
+ public :\
+ Final& operator&=(const Final& rhs) { \
+ Final::underlying(this) &= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_bitwise_and_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_BITWISE_AND_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final) \
+ public :\
+ Final& operator|=(const Final& rhs) { \
+ Final::underlying(this) |= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_bitwise_or_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final)
+ };
+ };
+
+#define BOOST_OPAQUE_USING_LEFT_SHIFT_ASSIGN(Final) \
+ public :\
+ Final& operator<<=(const Final& rhs) { \
+ Final::underlying(this) <<= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_left_shift_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ 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 :\
+ Final& operator>>=(const Final& rhs) { \
+ Final::underlying(this) >>= rhs.underlying();\
+ return Final::final(this); \
+ }
+
+ struct using_left_right_assign {
+ template <typename Final, typename Base>
+ struct type: Base {
+ 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) \
+ public :\
+ bool operator!() const { \
+ return !Final::underlying(this);\
+ }
+
+ struct using_logical_not {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_LOGICAL_NOT(Final)
+ };
+ };
+
+ 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 { \
+ return Final(+(Final::underlying(this)));\
+ }
+
+ struct using_unary_plus {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_UNARY_PLUS(Final)
+ };
+ };
+
+ 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 { \
+ return Final(-(Final::underlying(this))); \
+ }
+
+ struct using_unary_minus {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_UNARY_MINUS(Final)
+ };
+ };
+
+ 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 { \
+ return Final(~(Final::underlying(this))); \
+ }
+
+ struct using_bitwise_not {
+ template <typename Final, typename Base>
+ struct type: Base {
+ 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 {
+ //~ Final* operator&() {
+ //~ return this;
+ //~ }
+ //~ };
+
+ //~ template <typename Final, typename Derreference=typename reference<Final::underlying_type>::type, typename Base>
+ //~ struct derreference : Base {
+ //~ Derreference operator*() {
+ //~ return *(x.underlying());
+ //~ }
+ //~ };
+
+ //~ template <typename Final, typename Pointer=typename pointer<Final::underlying_type>::type, typename Base>
+ //~ struct member_access : Base {
+ //~ Pointer operator->() {
+ //~ return x.underlying().operator->();
+ //~ }
+ //~ };
+
+ //~ template <typename Final, class I, class R, typename Base>
+ //~ struct subscript : Base {
+ //~ R operator[](I n) {
+ //~ return x.underlying()[i];
+ //~ }
+ //~ };
+
+ // Increment and decrement
+#define BOOST_OPAQUE_USING_PRE_INCREMENT(Final) \
+ public :\
+ Final operator++() { \
+ ++Final::underlying(this); \
+ return Final::final(this); \
+ }
+
+ struct using_pre_increment {
+ template <typename Final, typename Base>
+ struct type: Base {
+ 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 :\
+ Final operator--() { \
+ --Final::underlying(this); \
+ return Final::final(this); \
+ }
+
+ struct using_pre_decrement {
+ template <typename Final, typename Base>
+ struct type: Base {
+ 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 :\
+ Final operator++(int) { \
+ Final nrv(Final::final(this)); \
+ Final::underlying(this)++; \
+ return nrv; \
+ }
+
+ struct using_post_increment {
+ template <typename Final, typename Base>
+ struct type: Base {
+ 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 :\
+ Final operator--(int) { \
+ Final nrv(Final::final(this)); \
+ Final::underlying(this)--; \
+ return nrv; \
+ }
+
+ struct using_post_decrement {
+ template <typename Final, typename Base>
+ struct type: Base {
+ 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 :(
+
+#define BOOST_OPAQUE_USING_PLUS(Final) \
+ public :\
+ Final operator+(const Final& rhs) const { \
+ return Final(Final::underlying(this) + rhs.underlying()); \
+ }
+
+#define BOOST_OPAQUE_USING_MINUS(Final) \
+ public :\
+ Final operator-(const Final& rhs) const { \
+ return Final(Final::underlying(this) - rhs.underlying()); \
+ }
+#else
+#define BOOST_OPAQUE_USING_PLUS(Final) \
+ public :\
+ friend Final operator+(const Final& lhs, const Final& rhs) { \
+ return Final(lhs.underlying() + rhs.underlying()); \
+ }
+#define BOOST_OPAQUE_USING_MINUS(Final) \
+ public :\
+ friend Final operator-(const Final& lhs, const Final& rhs) { \
+ return Final(lhs.underlying() - rhs.underlying()); \
+ }
+#endif
+
+#define BOOST_OPAQUE_USING_MULTIPLY(Final) \
+ public :\
+ Final operator*(const Final& rhs) const { \
+ return Final(Final::underlying(this) * rhs.underlying()); \
+ }
+
+#define BOOST_OPAQUE_USING_DIVIDE(Final) \
+ public :\
+ Final operator/(const Final& rhs) const { \
+ return Final(Final::underlying(this) / rhs.underlying()); \
+ }
+
+#define BOOST_OPAQUE_USING_MODULUS(Final) \
+ public :\
+ Final operator%(const Final& rhs) const { \
+ return Final(Final::underlying(this) % rhs.underlying()); \
+ }
+
+#define BOOST_OPAQUE_USING_BITWISE_XOR(Final) \
+ public :\
+ Final operator^(const Final& rhs) const { \
+ return Final(Final::underlying(this) ^ rhs.underlying()); \
+ }
+
+#define BOOST_OPAQUE_USING_BITWISE_OR(Final) \
+ public :\
+ Final operator|(const Final& rhs) const { \
+ return Final(Final::underlying(this) | rhs.underlying()); \
+ }
+
+#define BOOST_OPAQUE_USING_BITWISE_AND(Final) \
+ public :\
+ Final operator&(const Final& rhs) const { \
+ 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()); \
+ }
+
+}
+}
+}
+
+
+#endif
Added: sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp
==============================================================================
--- (empty file)
+++ sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -0,0 +1,74 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2010.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/opaque for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_OPAQUE_TRANSITIVE_EXPLICIT_SUBSTITUABLE_HPP
+#define BOOST_OPAQUE_TRANSITIVE_EXPLICIT_SUBSTITUABLE_HPP
+
+#include <boost/opaque/meta_mixin/combined_operators.hpp>
+
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/mpl/and.hpp>
+
+namespace boost {
+
+
+ template <typename BaseClass>
+ struct transitive_explicit_substituable;
+
+ namespace detail {
+
+ template <typename BaseClass, typename Final, typename UT, typename Base, bool B>
+ struct transitive_explicit_substituable_next_level;
+
+ template <typename BaseClass, typename Final, typename UT, typename Base>
+ struct transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base, true>
+ : transitive_explicit_substituable<BaseClass>::template
+ type<Final, typename UT::underlying_type, Base>
+ {};
+ template <typename BaseClass, typename Final, typename UT, typename Base>
+ struct transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base, false>
+ : Base
+ {};
+
+ }
+ namespace dummy {
+ template <typename T> struct base_tag {};
+ template <typename T> struct type_tag : public base_tag<T> {};
+ }
+
+ template <typename BaseClass>
+ struct transitive_explicit_substituable {
+ template <typename Final, typename UT, typename Base>
+ struct type
+ : detail::transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base,
+ mpl::and_<is_class<UT>, is_base_of<BaseClass, UT> >::value>
+ {
+ #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
+ friend UT convert_to(Final const& rhs, boost::dummy::type_tag<UT> const&)
+ {
+ return Final::final(&rhs).underlying();
+ }
+ #else
+ explicit operator UT() const
+ {
+ return Final::final(this).underlying();
+ }
+ #endif
+ };
+ };
+
+
+}
+
+
+#endif
Added: sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp
==============================================================================
--- (empty file)
+++ sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2010.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/opaque for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_OPAQUE_TRANSITIVE_SUBSTITUABLE_HPP
+#define BOOST_OPAQUE_TRANSITIVE_SUBSTITUABLE_HPP
+
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/mpl/and.hpp>
+
+namespace boost {
+
+ template <typename BaseClass, typename UT>
+ struct transitive_substituable;
+
+ namespace detail {
+
+ template <typename BaseClass, typename Final, typename UT, typename Base, bool IsConvertible>
+ struct transitive_substituable_next_level;
+
+ template <typename BaseClass, typename Final, typename UT, typename Base>
+ struct transitive_substituable_next_level<BaseClass, Final, UT, Base, true>
+ : transitive_substituable<BaseClass, typename UT::underlying_type>::template type<Final, Base> { };
+
+ template <typename BaseClass, typename Final, typename UT, typename Base>
+ struct transitive_substituable_next_level<BaseClass, Final, UT, Base, false> : Base { };
+
+ }
+
+ template <typename BaseClass, typename UT>
+ struct transitive_substituable {
+ template <typename Final, typename Base>
+ struct type
+ : detail::transitive_substituable_next_level<BaseClass, Final, UT, Base,
+ mpl::and_<is_class<UT>, is_base_of<BaseClass, UT> >::value>
+ {
+ operator UT() const {
+ return Final::final(this).underlying();
+ }
+ };
+ };
+
+}
+
+#endif
Modified: sandbox/opaque/boost/opaque/new_class.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/new_class.hpp (original)
+++ sandbox/opaque/boost/opaque/new_class.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -13,7 +13,7 @@
#ifndef BOOST_OPAQUE_NEW_CLASS_HPP
#define BOOST_OPAQUE_NEW_CLASS_HPP
-#include <boost/opaque/linear_hierarchy.hpp>
+#include <boost/opaque/meta_mixin/linear_hierarchy.hpp>
namespace boost {
Modified: sandbox/opaque/boost/opaque/opaque.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/opaque.hpp (original)
+++ sandbox/opaque/boost/opaque/opaque.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -15,7 +15,8 @@
#include <boost/opaque/new_type.hpp>
#include <boost/opaque/new_class.hpp>
-#include <boost/opaque/operators.hpp>
+#include <boost/opaque/meta_mixin/operators.hpp>
+#include <boost/opaque/meta_mixin/combined_operators.hpp>
#include <boost/opaque/private_opaque_type.hpp>
#include <boost/opaque/private_opaque_class.hpp>
#include <boost/opaque/public_opaque_type.hpp>
@@ -28,7 +29,6 @@
#define BOOST_OPAQUE_STATIC_ASSERT(CND, MSG, TYPES) \
BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
-
namespace boost {
#if 0
Modified: sandbox/opaque/boost/opaque/opaque_type.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/opaque_type.hpp (original)
+++ sandbox/opaque/boost/opaque/opaque_type.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -14,7 +14,7 @@
#define BOOST_OPAQUE_OPAQUE_TYPE_HPP
#include <boost/opaque/new_type.hpp>
-#include <boost/opaque/combined_operators.hpp>
+#include <boost/opaque/meta_mixin/combined_operators.hpp>
namespace boost {
Deleted: sandbox/opaque/boost/opaque/operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/operators.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
+++ (empty file)
@@ -1,570 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_OPERATORS_HPP
-#define BOOST_OPAQUE_OPERATORS_HPP
-
-#include <boost/operators.hpp>
-
-namespace boost {
-
-namespace opaque {
-namespace ope {
-
-#define BOOST_OPAQUE_HIDING_COPY(T) \
- private: \
- T( const T& );
-
- struct hiding_copy {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_HIDING_COPY(type)
- };
- };
-
-#define BOOST_OPAQUE_HIDING_ASSIGN(T) \
- private: \
- T& operator=(T const&);
-
- struct hiding_assign {
- template <typename Final, typename Base>
- struct type : Base {
- BOOST_OPAQUE_HIDING_ASSIGN(type)
- };
- };
-
-#define BOOST_OPAQUE_USING_CONVERSION(Final,UT) \
- public: \
- operator UT() const{ \
- return Final::underlying(this); \
- }
-
- template <typename UT>
- struct using_conversion {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_CONVERSION(Final,UT)
- };
- };
-
- template <typename T>
- struct using_conversion_to {
- template <typename Final, typename Base>
- struct type: Base {
- operator T() const{
- return T(Final::underlying(this));
- }
- };
- };
-
- struct using_conversion_safe_bool {
- template <typename Final, typename Base>
- struct type: Base {
- typedef typename Final::underlying_type const& (Final::*unspecified_bool_type)() const;
-
- operator unspecified_bool_type() const
- {
- return Final::underlying(this) ? &Final::underlying : 0;
- }
- };
- };
-
-
-
-#define BOOST_OPAQUE_USING_LESS_THAN(Final, Bool) \
- public :\
- Bool operator<(const Final& rhs) const { \
- return Bool(Final::underlying(this) < rhs.underlying());\
- }
-
- template <typename Bool=bool>
- struct using_less_than {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_LESS_THAN(Final,Bool)
- };
- };
-
-#define BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool) \
- public :\
- Bool operator<=(const Final& rhs) const { \
- return Bool(Final::underlying(this) <= rhs.underlying());\
- }
-
- template <typename Bool=bool>
- struct using_less_than_equal {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_LESS_THAN_EQUAL(Final,Bool)
- };
- };
-
-#define BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool) \
- public :\
- Bool operator>(const Final& rhs) const { \
- return Bool(Final::underlying(this) > rhs.underlying());\
- }
-
- template <typename Bool=bool>
- struct using_greater_than {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_GREATER_THAN(Final,Bool)
- };
- };
-
-#define BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool) \
- public :\
- Bool operator>=(const Final& rhs) const { \
- return Bool(Final::underlying(this) >= rhs.underlying());\
- }
-
- template <typename Bool=bool>
- struct using_greater_than_equal {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_GREATER_THAN_EQUAL(Final,Bool)
- };
- };
-
-#define BOOST_OPAQUE_USING_EQUAL(Final,Bool) \
- public :\
- Bool operator==(const Final& rhs) const { \
- return Bool(Final::underlying(this) == rhs.underlying());\
- }
-
- template <typename Bool=bool>
- struct using_equal {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_EQUAL(Final,Bool)
- };
- };
-
-#define BOOST_OPAQUE_USING_NOT_EQUAL(Final,Bool) \
- public :\
- Bool operator!=(const Final& rhs) const { \
- return Bool(Final::underlying(this) != rhs.underlying());\
- }
-
- template <typename Bool=bool>
- struct using_not_equal {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_NOT_EQUAL(Final,Bool)
- };
- };
-
-#define BOOST_OPAQUE_USING_PLUS_ASSIGN(Final) \
- public :\
- Final& operator+=(const Final& rhs) { \
- Final::underlying(this) += rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_plus_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_PLUS_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_MINUS_ASSIGN(Final) \
- public :\
- Final& operator-=(const Final& rhs) { \
- Final::underlying(this) -= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_minus_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_MINUS_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_MULTIPLY_ASSIGN(Final) \
- public :\
- Final& operator*=(const Final& rhs) { \
- Final::underlying(this) *= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_multiply_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_MULTIPLY_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_DIVIDE_ASSIGN(Final) \
- public :\
- Final& operator/=(const Final& rhs) { \
- Final::underlying(this) /= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_divide_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_DIVIDE_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_MODULUS_ASSIGN(Final) \
- public :\
- Final& operator%=(const Final& rhs) { \
- Final::underlying(this) %= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_modulus_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_MODULUS_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_BITWISE_XOR_ASSIGN(Final) \
- public :\
- Final& operator^=(const Final& rhs) { \
- Final::underlying(this) ^= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_bitwise_xor_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_BITWISE_XOR_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_BITWISE_AND_ASSIGN(Final) \
- public :\
- Final& operator&=(const Final& rhs) { \
- Final::underlying(this) &= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_bitwise_and_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_BITWISE_AND_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final) \
- public :\
- Final& operator|=(const Final& rhs) { \
- Final::underlying(this) |= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_bitwise_or_assign {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_BITWISE_OR_ASSIGN(Final)
- };
- };
-
-#define BOOST_OPAQUE_USING_LEFT_SHIFT_ASSIGN(Final) \
- public :\
- Final& operator<<=(const Final& rhs) { \
- Final::underlying(this) <<= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_left_shift_assign {
- template <typename Final, typename Base>
- struct type: Base {
- 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 :\
- Final& operator>>=(const Final& rhs) { \
- Final::underlying(this) >>= rhs.underlying();\
- return Final::final(this); \
- }
-
- struct using_left_right_assign {
- template <typename Final, typename Base>
- struct type: Base {
- 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) \
- public :\
- bool operator!() const { \
- return !Final::underlying(this);\
- }
-
- struct using_logical_not {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_LOGICAL_NOT(Final)
- };
- };
-
- 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 { \
- return Final(+(Final::underlying(this)));\
- }
-
- struct using_unary_plus {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_UNARY_PLUS(Final)
- };
- };
-
- 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 { \
- return Final(-(Final::underlying(this))); \
- }
-
- struct using_unary_minus {
- template <typename Final, typename Base>
- struct type: Base {
- BOOST_OPAQUE_USING_UNARY_MINUS(Final)
- };
- };
-
- 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 { \
- return Final(~(Final::underlying(this))); \
- }
-
- struct using_bitwise_not {
- template <typename Final, typename Base>
- struct type: Base {
- 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 {
- //~ Final* operator&() {
- //~ return this;
- //~ }
- //~ };
-
- //~ template <typename Final, typename Derreference=typename reference<Final::underlying_type>::type, typename Base>
- //~ struct derreference : Base {
- //~ Derreference operator*() {
- //~ return *(x.underlying());
- //~ }
- //~ };
-
- //~ template <typename Final, typename Pointer=typename pointer<Final::underlying_type>::type, typename Base>
- //~ struct member_access : Base {
- //~ Pointer operator->() {
- //~ return x.underlying().operator->();
- //~ }
- //~ };
-
- //~ template <typename Final, class I, class R, typename Base>
- //~ struct subscript : Base {
- //~ R operator[](I n) {
- //~ return x.underlying()[i];
- //~ }
- //~ };
-
- // Increment and decrement
-#define BOOST_OPAQUE_USING_PRE_INCREMENT(Final) \
- public :\
- Final operator++() { \
- ++Final::underlying(this); \
- return Final::final(this); \
- }
-
- struct using_pre_increment {
- template <typename Final, typename Base>
- struct type: Base {
- 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 :\
- Final operator--() { \
- --Final::underlying(this); \
- return Final::final(this); \
- }
-
- struct using_pre_decrement {
- template <typename Final, typename Base>
- struct type: Base {
- 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 :\
- Final operator++(int) { \
- Final nrv(Final::final(this)); \
- Final::underlying(this)++; \
- return nrv; \
- }
-
- struct using_post_increment {
- template <typename Final, typename Base>
- struct type: Base {
- 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 :\
- Final operator--(int) { \
- Final nrv(Final::final(this)); \
- Final::underlying(this)--; \
- return nrv; \
- }
-
- struct using_post_decrement {
- template <typename Final, typename Base>
- struct type: Base {
- 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 :(
-
-#define BOOST_OPAQUE_USING_PLUS(Final) \
- public :\
- Final operator+(const Final& rhs) const { \
- return Final(Final::underlying(this) + rhs.underlying()); \
- }
-
-#define BOOST_OPAQUE_USING_MINUS(Final) \
- public :\
- Final operator-(const Final& rhs) const { \
- return Final(Final::underlying(this) - rhs.underlying()); \
- }
-#else
-#define BOOST_OPAQUE_USING_PLUS(Final) \
- public :\
- friend Final operator+(const Final& lhs, const Final& rhs) { \
- return Final(lhs.underlying() + rhs.underlying()); \
- }
-#define BOOST_OPAQUE_USING_MINUS(Final) \
- public :\
- friend Final operator-(const Final& lhs, const Final& rhs) { \
- return Final(lhs.underlying() - rhs.underlying()); \
- }
-#endif
-
-#define BOOST_OPAQUE_USING_MULTIPLY(Final) \
- public :\
- Final operator*(const Final& rhs) const { \
- return Final(Final::underlying(this) * rhs.underlying()); \
- }
-
-#define BOOST_OPAQUE_USING_DIVIDE(Final) \
- public :\
- Final operator/(const Final& rhs) const { \
- return Final(Final::underlying(this) / rhs.underlying()); \
- }
-
-#define BOOST_OPAQUE_USING_MODULUS(Final) \
- public :\
- Final operator%(const Final& rhs) const { \
- return Final(Final::underlying(this) % rhs.underlying()); \
- }
-
-#define BOOST_OPAQUE_USING_BITWISE_XOR(Final) \
- public :\
- Final operator^(const Final& rhs) const { \
- return Final(Final::underlying(this) ^ rhs.underlying()); \
- }
-
-#define BOOST_OPAQUE_USING_BITWISE_OR(Final) \
- public :\
- Final operator|(const Final& rhs) const { \
- return Final(Final::underlying(this) | rhs.underlying()); \
- }
-
-#define BOOST_OPAQUE_USING_BITWISE_AND(Final) \
- public :\
- Final operator&(const Final& rhs) const { \
- 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()); \
- }
-
-}
-}
-}
-
-
-#endif
Modified: sandbox/opaque/boost/opaque/private_opaque_class.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/private_opaque_class.hpp (original)
+++ sandbox/opaque/boost/opaque/private_opaque_class.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -13,8 +13,8 @@
#ifndef BOOST_OPAQUE_PRIVATE_OPAQUE_CLASS_HPP
#define BOOST_OPAQUE_PRIVATE_OPAQUE_CLASS_HPP
-#include <boost/opaque/combined_operators.hpp>
-#include <boost/opaque/transitive_explicit_substituable.hpp>
+#include <boost/opaque/meta_mixin/combined_operators.hpp>
+#include <boost/opaque/meta_mixin/transitive_explicit_substituable.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_base_of.hpp>
Modified: sandbox/opaque/boost/opaque/private_opaque_type.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/private_opaque_type.hpp (original)
+++ sandbox/opaque/boost/opaque/private_opaque_type.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -13,7 +13,7 @@
#ifndef BOOST_OPAQUE_PRIVATE_OPAQUE_TYPE_HPP
#define BOOST_OPAQUE_PRIVATE_OPAQUE_TYPE_HPP
-#include <boost/opaque/combined_operators.hpp>
+#include <boost/opaque/meta_mixin/combined_operators.hpp>
#include <boost/opaque/new_type.hpp>
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/private_opaque_class.hpp>
Modified: sandbox/opaque/boost/opaque/public_opaque_class.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/public_opaque_class.hpp (original)
+++ sandbox/opaque/boost/opaque/public_opaque_class.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -13,8 +13,8 @@
#ifndef BOOST_OPAQUE_PUBLIC_OPAQUE_CLASS_HPP
#define BOOST_OPAQUE_PUBLIC_OPAQUE_CLASS_HPP
-#include <boost/opaque/combined_operators.hpp>
-#include <boost/opaque/transitive_substituable.hpp>
+#include <boost/opaque/meta_mixin/combined_operators.hpp>
+#include <boost/opaque/meta_mixin/transitive_substituable.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_base_of.hpp>
Modified: sandbox/opaque/boost/opaque/public_opaque_type.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/public_opaque_type.hpp (original)
+++ sandbox/opaque/boost/opaque/public_opaque_type.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
@@ -13,7 +13,7 @@
#ifndef BOOST_OPAQUE_PUBLIC_OPAQUE_TYPE_HPP
#define BOOST_OPAQUE_PUBLIC_OPAQUE_TYPE_HPP
-#include <boost/opaque/combined_operators.hpp>
+#include <boost/opaque/meta_mixin/combined_operators.hpp>
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/public_opaque_class.hpp>
Deleted: sandbox/opaque/boost/opaque/transitive_explicit_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/transitive_explicit_substituable.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
+++ (empty file)
@@ -1,74 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_TRANSITIVE_EXPLICIT_SUBSTITUABLE_HPP
-#define BOOST_OPAQUE_TRANSITIVE_EXPLICIT_SUBSTITUABLE_HPP
-
-#include <boost/opaque/combined_operators.hpp>
-
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/mpl/and.hpp>
-
-namespace boost {
-
-
- template <typename BaseClass>
- struct transitive_explicit_substituable;
-
- namespace detail {
-
- template <typename BaseClass, typename Final, typename UT, typename Base, bool B>
- struct transitive_explicit_substituable_next_level;
-
- template <typename BaseClass, typename Final, typename UT, typename Base>
- struct transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base, true>
- : transitive_explicit_substituable<BaseClass>::template
- type<Final, typename UT::underlying_type, Base>
- {};
- template <typename BaseClass, typename Final, typename UT, typename Base>
- struct transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base, false>
- : Base
- {};
-
- }
- namespace dummy {
- template <typename T> struct base_tag {};
- template <typename T> struct type_tag : public base_tag<T> {};
- }
-
- template <typename BaseClass>
- struct transitive_explicit_substituable {
- template <typename Final, typename UT, typename Base>
- struct type
- : detail::transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base,
- mpl::and_<is_class<UT>, is_base_of<BaseClass, UT> >::value>
- {
- #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
- friend UT convert_to(Final const& rhs, boost::dummy::type_tag<UT> const&)
- {
- return Final::final(&rhs).underlying();
- }
- #else
- explicit operator UT() const
- {
- return Final::final(this).underlying();
- }
- #endif
- };
- };
-
-
-}
-
-
-#endif
Deleted: sandbox/opaque/boost/opaque/transitive_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/transitive_substituable.hpp 2010-10-02 13:35:49 EDT (Sat, 02 Oct 2010)
+++ (empty file)
@@ -1,54 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_TRANSITIVE_SUBSTITUABLE_HPP
-#define BOOST_OPAQUE_TRANSITIVE_SUBSTITUABLE_HPP
-
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/mpl/and.hpp>
-
-namespace boost {
-
- template <typename BaseClass, typename UT>
- struct transitive_substituable;
-
- namespace detail {
-
- template <typename BaseClass, typename Final, typename UT, typename Base, bool IsConvertible>
- struct transitive_substituable_next_level;
-
- template <typename BaseClass, typename Final, typename UT, typename Base>
- struct transitive_substituable_next_level<BaseClass, Final, UT, Base, true>
- : transitive_substituable<BaseClass, typename UT::underlying_type>::template type<Final, Base> { };
-
- template <typename BaseClass, typename Final, typename UT, typename Base>
- struct transitive_substituable_next_level<BaseClass, Final, UT, Base, false> : Base { };
-
- }
-
- template <typename BaseClass, typename UT>
- struct transitive_substituable {
- template <typename Final, typename Base>
- struct type
- : detail::transitive_substituable_next_level<BaseClass, Final, UT, Base,
- mpl::and_<is_class<UT>, is_base_of<BaseClass, UT> >::value>
- {
- operator UT() const {
- return Final::final(this).underlying();
- }
- };
- };
-
-}
-
-#endif
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