|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65729 - in sandbox/opaque/boost/opaque: . meta_mixin
From: vicente.botet_at_[hidden]
Date: 2010-10-02 16:29:10
Author: viboes
Date: 2010-10-02 16:29:09 EDT (Sat, 02 Oct 2010)
New Revision: 65729
URL: http://svn.boost.org/trac/boost/changeset/65729
Log:
Opaque:
* Add inherited_from_underlying.hpp
Text files modified:
sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp | 13 --------
sandbox/opaque/boost/opaque/private_opaque_class.hpp | 41 ++++++++++++++++++---------
sandbox/opaque/boost/opaque/private_opaque_type.hpp | 32 +++++++++++----------
sandbox/opaque/boost/opaque/public_opaque_class.hpp | 59 +++++++++++++++++++++++++--------------
sandbox/opaque/boost/opaque/public_opaque_type.hpp | 38 +++++++++++++------------
5 files changed, 101 insertions(+), 82 deletions(-)
Modified: sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp (original)
+++ sandbox/opaque/boost/opaque/meta_mixin/combined_operators.hpp 2010-10-02 16:29:09 EDT (Sat, 02 Oct 2010)
@@ -438,19 +438,6 @@
};
}
- 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)
- };
- };
}
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 16:29:09 EDT (Sat, 02 Oct 2010)
@@ -13,7 +13,7 @@
#ifndef BOOST_OPAQUE_PRIVATE_OPAQUE_CLASS_HPP
#define BOOST_OPAQUE_PRIVATE_OPAQUE_CLASS_HPP
-#include <boost/opaque/meta_mixin/combined_operators.hpp>
+#include <boost/opaque/meta_mixin/inherited_from_underlying.hpp>
#include <boost/opaque/meta_mixin/transitive_explicit_substituable.hpp>
#include <boost/type_traits/is_class.hpp>
@@ -23,34 +23,47 @@
namespace boost {
class base_private_opaque_type {};
- template <typename Final, typename T, typename MetaMixinSeq=boost::mpl::vector0<>, typename Base=base_private_opaque_type>
- class private_opaque_class : public
- new_class< Final, T, MetaMixinSeq,
- transitive_explicit_substituable<base_private_opaque_type>::template type<Final, T,
- typename inherited_from_undelying<T>::template type<Final, Base>
+ template <
+ typename Final,
+ typename T,
+ typename MetaMixinSeq=boost::mpl::vector0<>,
+ typename Base=base_private_opaque_type
+ >
+ class private_opaque_class
+ : public
+ new_class< Final, T, MetaMixinSeq,
+ transitive_explicit_substituable<base_private_opaque_type>
+ ::template type<Final, T,
+ typename opaque::inherited_from_underlying<T>
+ ::template type<Final, Base>
>
>
{
typedef
new_class< Final, T, MetaMixinSeq,
- transitive_explicit_substituable<base_private_opaque_type>::template type<Final, T,
- typename inherited_from_undelying<T>::template type<Final, Base>
+ transitive_explicit_substituable<base_private_opaque_type>
+ ::template type<Final, T,
+ typename opaque::inherited_from_underlying<T>
+ ::template type<Final, Base>
>
>
base_type;
- protected:
- typedef private_opaque_class opaque_class_t;
+
public:
//~ Can instances of UT be explicitly converted to instances of OT? Yes
//~ Can instances of UT be implicitly converted to instances of OT? No
//~ Can instances of OT be explicitly converted to instances of UT? Yes.
- //~ Waiting for explicit conversion operators,, the explicit conversion must be done through the underlying function
+ //~ Waiting for explicit conversion operators,, the explicit
+ //~ conversion must be done through the underlying function
//~ Can instances of OT be implicitly converted to instances of UT? No
private_opaque_class() {};
- private_opaque_class(const opaque_class_t & rhs) : base_type(rhs.val_) {}
- private_opaque_class(const Final & rhs) : base_type(rhs.val_) {}
- explicit private_opaque_class(T v) : base_type(v) {};
+ private_opaque_class(const private_opaque_class & rhs)
+ : base_type(rhs.val_) {}
+ private_opaque_class(const Final & rhs)
+ : base_type(rhs.val_) {}
+ explicit private_opaque_class(T v)
+ : base_type(v) {};
template <typename W>
explicit private_opaque_class(W v)
: base_type(v)
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 16:29:09 EDT (Sat, 02 Oct 2010)
@@ -13,36 +13,38 @@
#ifndef BOOST_OPAQUE_PRIVATE_OPAQUE_TYPE_HPP
#define BOOST_OPAQUE_PRIVATE_OPAQUE_TYPE_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>
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/mpl/and.hpp>
-
namespace boost {
- template <typename T, typename Tag=void, typename MetaMixinSeq=boost::mpl::vector0<>, typename Base=base_private_opaque_type>
+ template <
+ typename T,
+ typename Tag=void,
+ typename MetaMixinSeq=boost::mpl::vector0<>,
+ typename Base=base_private_opaque_type
+ >
class private_opaque_type : public
- private_opaque_class< private_opaque_type<T,Tag,MetaMixinSeq,Base>, T, MetaMixinSeq, Base>
+ private_opaque_class< private_opaque_type<T,Tag,MetaMixinSeq,Base>,
+ T, MetaMixinSeq, Base>
{
typedef
- private_opaque_class< private_opaque_type<T,Tag,MetaMixinSeq,Base>, T, MetaMixinSeq, Base>
+ private_opaque_class< private_opaque_type<T,Tag,MetaMixinSeq,Base>,
+ T, MetaMixinSeq, Base>
base_type;
- protected:
- typedef private_opaque_type opaque_type_t;
+
public:
//~ Can instances of UT be explicitly converted to instances of OT? Yes
//~ Can instances of UT be implicitly converted to instances of OT? No
//~ Can instances of OT be explicitly converted to instances of UT? Yes.
- //~ Waiting for explicit conversion operators,, the explicit conversion must be done through the underlying function
+ //~ Waiting for explicit conversion operators,, the explicit
+ //~ conversion must be done through the underlying function
//~ Can instances of OT be implicitly converted to instances of UT? No
private_opaque_type() {};
- private_opaque_type(const opaque_type_t & rhs) : base_type(rhs.val_) {}
- explicit private_opaque_type(T v) : base_type(v) {};
+ private_opaque_type(const private_opaque_type & rhs)
+ : base_type(rhs.val_) {}
+ explicit private_opaque_type(T v)
+ : base_type(v) {};
template <typename W>
explicit private_opaque_type(W v)
: base_type(v)
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 16:29:09 EDT (Sat, 02 Oct 2010)
@@ -13,7 +13,7 @@
#ifndef BOOST_OPAQUE_PUBLIC_OPAQUE_CLASS_HPP
#define BOOST_OPAQUE_PUBLIC_OPAQUE_CLASS_HPP
-#include <boost/opaque/meta_mixin/combined_operators.hpp>
+#include <boost/opaque/meta_mixin/inherited_from_underlying.hpp>
#include <boost/opaque/meta_mixin/transitive_substituable.hpp>
#include <boost/type_traits/is_class.hpp>
@@ -31,7 +31,8 @@
template <typename T>
struct get_substituables<T,true> {
- typedef typename mpl::push_front<typename T::substituables, T>::type type;
+ typedef typename mpl::push_front<typename T::substituables, T
+ >::type type;
};
template <typename T>
@@ -42,10 +43,11 @@
template <typename BaseClass, typename UT>
struct transitive_substituable_help {
template <typename Final, typename Base>
- struct type : transitive_substituable<BaseClass, UT>::template type<Final,
- typename inherited_from_undelying<UT>::template type<Final, Base>
- >
-
+ struct type
+ : transitive_substituable<BaseClass, UT>::template type<Final,
+ typename opaque::inherited_from_underlying<UT>
+ ::template type<Final, Base>
+ >
{
operator UT() const {
return Final::final(this).underlying();
@@ -53,18 +55,24 @@
};
};
-
-
- template <typename Final, typename T, typename MetaMixinSeq=boost::mpl::vector0<>, typename Base=base_public_opaque_type>
+ template <
+ typename Final,
+ typename T,
+ typename MetaMixinSeq=boost::mpl::vector0<>,
+ typename Base=base_public_opaque_type
+ >
class public_opaque_class
: public
new_class< Final, T, MetaMixinSeq,
#define COMPILER_WORKS
#if !defined(COMPILER_WORKS)
- typename transitive_substituable_help<base_public_opaque_type, T>::template type<Final, Base>
+ typename transitive_substituable_help<base_public_opaque_type,T>
+ ::template type<Final, Base>
#else
- typename transitive_substituable<base_public_opaque_type, T>::template type<Final,
- typename inherited_from_undelying<T>::template type<Final, Base>
+ typename transitive_substituable<base_public_opaque_type, T>
+ ::template type<Final,
+ typename opaque::inherited_from_underlying<T>
+ ::template type<Final, Base>
>
#endif
>
@@ -73,20 +81,23 @@
typedef
new_class< Final, T, MetaMixinSeq,
#if !defined(COMPILER_WORKS)
- typename transitive_substituable_help<base_public_opaque_type, T>::template type<Final, Base>
+ typename transitive_substituable_help<base_public_opaque_type,T>
+ ::template type<Final, Base>
#else
- typename transitive_substituable<base_public_opaque_type, T>::template type<Final,
- typename inherited_from_undelying<T>::template type<Final, Base>
+ typename transitive_substituable<base_public_opaque_type, T>
+ ::template type<Final,
+ typename opaque::inherited_from_underlying<T>
+ ::template type<Final, Base>
>
#endif
>
base_type;
- protected:
- typedef public_opaque_class opaque_class_t;
public:
typedef typename get_substituables<T,
- mpl::and_<is_class<T>, is_base_of<base_public_opaque_type,T> >::value
+ mpl::and_< is_class<T>,
+ is_base_of<base_public_opaque_type,T>
+ >::value
>::type substituables;
//~ Can instances of UT be explicitly converted to instances of OT? Yes
@@ -95,11 +106,15 @@
//~ Can instances of OT be implicitly converted to instances of UT? Yes
public_opaque_class() {}
- public_opaque_class(const opaque_class_t & rhs) : base_type(rhs.val_){}
- public_opaque_class(const Final & rhs) : base_type(rhs.val_){}
- explicit public_opaque_class(T v) : base_type(v) {}
+ public_opaque_class(const public_opaque_class & rhs)
+ : base_type(rhs.val_){}
+ public_opaque_class(const Final & rhs)
+ : base_type(rhs.val_){}
+ explicit public_opaque_class(T v)
+ : base_type(v) {}
template <typename W>
- explicit public_opaque_class(W v) : base_type(v) {}
+ explicit public_opaque_class(W v)
+ : base_type(v) {}
};
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 16:29:09 EDT (Sat, 02 Oct 2010)
@@ -13,26 +13,25 @@
#ifndef BOOST_OPAQUE_PUBLIC_OPAQUE_TYPE_HPP
#define BOOST_OPAQUE_PUBLIC_OPAQUE_TYPE_HPP
-#include <boost/opaque/meta_mixin/combined_operators.hpp>
-#include <boost/opaque/new_class.hpp>
#include <boost/opaque/public_opaque_class.hpp>
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/mpl/push_front.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/vector.hpp>
-
namespace boost {
-
- template <typename T, typename Tag=void, typename MetaMixinSeq=boost::mpl::vector0<>, typename Base=base_public_opaque_type>
+ template <
+ typename T,
+ typename Tag=void,
+ typename MetaMixinSeq=boost::mpl::vector0<>,
+ typename Base=base_public_opaque_type
+ >
class public_opaque_type
- : public public_opaque_class< public_opaque_type<T,Tag,MetaMixinSeq,Base>, T, MetaMixinSeq, Base>
+ : public
+ public_opaque_class< public_opaque_type<T,Tag,MetaMixinSeq,Base>,
+ T, MetaMixinSeq, Base>
{
- typedef public_opaque_class< public_opaque_type<T,Tag,MetaMixinSeq,Base>, T, MetaMixinSeq, Base> base_type;
- protected:
- typedef public_opaque_type opaque_type_t;
+ typedef
+ public_opaque_class< public_opaque_type<T,Tag,MetaMixinSeq,Base>,
+ T, MetaMixinSeq, Base> base_type;
+
public:
//~ Can instances of UT be explicitly converted to instances of OT? Yes
//~ Can instances of UT be implicitly converted to instances of OT? No
@@ -40,13 +39,16 @@
//~ Can instances of OT be implicitly converted to instances of UT? Yes
public_opaque_type() {}
- public_opaque_type(const opaque_type_t & rhs) : base_type(rhs.val_){}
- explicit public_opaque_type(T v) : base_type(v) {}
+ public_opaque_type(const public_opaque_type & rhs)
+ : base_type(rhs.val_) {}
+ explicit public_opaque_type(T v)
+ : base_type(v) {}
template <typename W>
- explicit public_opaque_type(W v) : base_type(v) {}
+ explicit public_opaque_type(W v)
+ : base_type(v) {}
};
-
+
}
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