|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65819 - in sandbox/opaque/boost/opaque: . meta_mixin
From: vicente.botet_at_[hidden]
Date: 2010-10-07 18:40:34
Author: viboes
Date: 2010-10-07 18:40:32 EDT (Thu, 07 Oct 2010)
New Revision: 65819
URL: http://svn.boost.org/trac/boost/changeset/65819
Log:
Opaque:
* Move all to the opaque namespace
Text files modified:
sandbox/opaque/boost/opaque/macros.hpp | 33 +++++++++++++++++++++++++--------
sandbox/opaque/boost/opaque/meta_mixin/linear_hierarchy.hpp | 8 +++++---
sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp | 9 +++++----
sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp | 6 ++++--
sandbox/opaque/boost/opaque/new_class.hpp | 9 +++++----
sandbox/opaque/boost/opaque/new_type.hpp | 3 ++-
sandbox/opaque/boost/opaque/private_opaque_class.hpp | 11 ++++++-----
sandbox/opaque/boost/opaque/private_opaque_type.hpp | 3 ++-
sandbox/opaque/boost/opaque/public_opaque_class.hpp | 23 +++++++++++++----------
sandbox/opaque/boost/opaque/public_opaque_type.hpp | 3 ++-
10 files changed, 69 insertions(+), 39 deletions(-)
Modified: sandbox/opaque/boost/opaque/macros.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/macros.hpp (original)
+++ sandbox/opaque/boost/opaque/macros.hpp 2010-10-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -23,10 +23,10 @@
OT(){} \
template <typename W> \
explicit OT(W w) \
- : boost::public_opaque_class<OT, UT>(w) \
+ : boost::opaque::public_opaque_class<OT, UT>(w) \
{}\
OT(OT const& r) \
- : boost::public_opaque_class<OT, UT>(r) \
+ : boost::opaque::public_opaque_class<OT, UT>(r) \
{}
#define BOOST_OPAQUE_PUBLIC_OPERATIONS(UT, OT) \
@@ -35,16 +35,33 @@
#if 0
#define BOOST_OPAQUE_PUBLIC_TYPEDEF(UT, OT) \
-struct OT: boost::public_opaque_class<OT, UT> \
+struct OT: boost::opaque::public_opaque_class<OT, UT> \
{\
BOOST_OPAQUE_PUBLIC_OPERATIONS(UT,OT);\
}
#else
#define BOOST_OPAQUE_PUBLIC_TYPEDEF(UT, OT) \
struct BOOST_JOIN(OT, _tag) {};\
-typedef boost::public_opaque_type<UT, BOOST_JOIN(OT, _tag)> OT
+typedef boost::opaque::public_opaque_type<UT, BOOST_JOIN(OT, _tag)> OT
#endif
+#define BOOST_OPAQUE_PUBLIC_CLASS(UT, NT1) \
+struct NT1 : boost::opaque::public_opaque_class<NT1, UT> \
+{ \
+ typedef \
+ boost::opaque::public_opaque_class<NT1, UT> \
+ base_type; \
+ \
+ NT1(){} \
+ explicit NT1(unsigned v) : base_type(v) {} \
+ template <typename W> \
+ explicit NT1(W w) \
+ : base_type(w) \
+ {} \
+ NT1(NT1 const& r) \
+ : base_type(r.val_) \
+ {} \
+}
//~ template <typename T> explicit OT(T v) : boost::private_opaque_type<OT, UT>(v) {}
@@ -52,10 +69,10 @@
OT(){}\
template <typename W> \
explicit OT(W w) \
- : boost::private_opaque_class<OT, UT>(w) \
+ : boost::opaque::private_opaque_class<OT, UT>(w) \
{}\
OT(OT const& r) \
- : boost::private_opaque_class<OT, UT>(r) \
+ : boost::opaque::private_opaque_class<OT, UT>(r) \
{}
#define BOOST_OPAQUE_PRIVATE_OPERATIONS(UT, OT) \
@@ -66,14 +83,14 @@
#if 0
#define BOOST_OPAQUE_PRIVATE_TYPEDEF(UT, OT) \
-struct OT: boost::private_opaque_class<OT, UT> \
+struct OT: boost::opaque::private_opaque_class<OT, UT> \
{\
BOOST_OPAQUE_PRIVATE_OPERATIONS(UT,OT);\
}
#else
#define BOOST_OPAQUE_PRIVATE_TYPEDEF(UT, OT) \
struct BOOST_JOIN(OT, _tag) {};\
-typedef boost::private_opaque_type<UT, BOOST_JOIN(OT, _tag)> OT
+typedef boost::opaque::private_opaque_type<UT, BOOST_JOIN(OT, _tag)> OT
#endif
Modified: sandbox/opaque/boost/opaque/meta_mixin/linear_hierarchy.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/linear_hierarchy.hpp (original)
+++ sandbox/opaque/boost/opaque/meta_mixin/linear_hierarchy.hpp 2010-10-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -17,9 +17,10 @@
#include <boost/mpl/fold.hpp>
namespace boost {
+namespace opaque {
////// implementation //////
- namespace detail{
+ namespace opaque_detail{
template<typename Final, typename State, typename MetaMixin>
struct do_inhetit : MetaMixin::template type< Final, State> {
@@ -37,9 +38,10 @@
template<typename MetaMixinSeq, typename Final, typename Base>
struct linear_hierarchy {
- typedef typename boost::mpl::fold<MetaMixinSeq, Base, detail::inherit<Final> >::type type;
+ typedef typename boost::mpl::fold<MetaMixinSeq, Base,
+ opaque_detail::inherit<Final> >::type type;
};
-
+}
}
Modified: sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp (original)
+++ sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp 2010-10-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -20,11 +20,12 @@
#include <boost/mpl/and.hpp>
namespace boost {
+namespace opaque {
template <typename BaseClass, typename UT>
struct transitive_explicit_substituable;
- namespace detail {
+ namespace opaque_detail {
template <
typename BaseClass,
@@ -63,12 +64,12 @@
struct transitive_explicit_substituable {
template <typename Final, typename Base>
struct type
- : detail::transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base,
+ : opaque_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&)
+ boost::opaque::dummy::type_tag<UT> const&)
{
return Final::final(&rhs).underlying();
}
@@ -81,7 +82,7 @@
};
};
-
+}
}
Modified: sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp (original)
+++ sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp 2010-10-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -18,11 +18,12 @@
#include <boost/mpl/and.hpp>
namespace boost {
+namespace opaque {
template <typename BaseClass, typename UT>
struct transitive_substituable;
- namespace detail {
+ namespace opaque_detail {
template <
typename BaseClass,
@@ -55,7 +56,7 @@
struct transitive_substituable {
template <typename Final, typename Base>
struct type
- : detail::transitive_substituable_next_level<
+ : opaque_detail::transitive_substituable_next_level<
BaseClass, Final, UT, Base,
mpl::and_<is_class<UT>, is_base_of<BaseClass, UT>
>::value>
@@ -67,5 +68,6 @@
};
}
+}
#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-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -16,6 +16,7 @@
#include <boost/opaque/meta_mixin/linear_hierarchy.hpp>
namespace boost {
+namespace opaque {
class base_new_type {};
@@ -37,9 +38,9 @@
explicit new_class(T v) : val_(v) {}
protected:
T val_;
- new_class & operator=(const new_class & rhs) {
- val_ = rhs.val_; return *this;
- }
+// new_class & operator=(const new_class & rhs) {
+// val_ = rhs.val_; return *this;
+// }
public:
underlying_type const& underlying() const {
@@ -81,7 +82,7 @@
{
return static_cast<T>(v.underlying());
}
-
+}
}
Modified: sandbox/opaque/boost/opaque/new_type.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/new_type.hpp (original)
+++ sandbox/opaque/boost/opaque/new_type.hpp 2010-10-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -17,6 +17,7 @@
#include <boost/mpl/vector.hpp>
namespace boost {
+namespace opaque {
template <
@@ -51,7 +52,7 @@
{
return static_cast<T>(v.underlying());
}
-
+}
}
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-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -22,6 +22,7 @@
#include <boost/mpl/push_front.hpp>
namespace boost {
+namespace opaque {
class base_private_opaque_type {};
template <
@@ -34,7 +35,7 @@
: public
#if 0
new_class< Final, T, MetaMixinSeq,
- transitive_explicit_substituable<base_private_opaque_type,T>
+ opaque::transitive_explicit_substituable<base_private_opaque_type,T>
::template type<Final,
typename opaque::inherited_from_underlying<T>
::template type<Final, Base>
@@ -45,7 +46,7 @@
typename mpl::push_front<
typename mpl::push_front<
MetaMixinSeq,
- transitive_explicit_substituable<base_private_opaque_type, T>
+ opaque::transitive_explicit_substituable<base_private_opaque_type, T>
>::type,
opaque::inherited_from_underlying<T>
>::type, Base
@@ -56,7 +57,7 @@
typedef
#if 0
new_class< Final, T, MetaMixinSeq,
- transitive_explicit_substituable<base_private_opaque_type,T>
+ opaque::transitive_explicit_substituable<base_private_opaque_type,T>
::template type<Final,
typename opaque::inherited_from_underlying<T>
::template type<Final, Base>
@@ -67,7 +68,7 @@
typename mpl::push_front<
typename mpl::push_front<
MetaMixinSeq,
- transitive_explicit_substituable<base_private_opaque_type, T>
+ opaque::transitive_explicit_substituable<base_private_opaque_type, T>
>::type,
opaque::inherited_from_underlying<T>
>::type, Base
@@ -95,7 +96,7 @@
: 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-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -16,6 +16,7 @@
#include <boost/opaque/private_opaque_class.hpp>
namespace boost {
+namespace opaque {
template <
typename T,
@@ -50,7 +51,7 @@
: 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-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -24,6 +24,7 @@
#include <boost/mpl/push_front.hpp>
namespace boost {
+namespace opaque {
class base_public_opaque_type {};
@@ -41,11 +42,13 @@
typedef mpl::vector<T> type;
};
+#if 0
+ namespace opaque_detail {
template <typename BaseClass, typename UT>
struct transitive_substituable_help {
template <typename Final, typename Base>
struct type
- : transitive_substituable<BaseClass, UT>::template type<Final,
+ : opaque::transitive_substituable<BaseClass, UT>::template type<Final,
typename opaque::inherited_from_underlying<UT>
::template type<Final, Base>
>
@@ -55,7 +58,9 @@
}
};
};
-
+ }
+#endif
+
template <
typename Final,
typename T,
@@ -68,10 +73,10 @@
new_class< Final, T, MetaMixinSeq,
#define COMPILER_WORKS
#if !defined(COMPILER_WORKS)
- typename transitive_substituable_help<base_public_opaque_type,T>
+ typename opaque_detail::transitive_substituable_help<base_public_opaque_type,T>
::template type<Final, Base>
#else
- typename transitive_substituable<base_public_opaque_type, T>
+ typename opaque::transitive_substituable<base_public_opaque_type, T>
::template type<Final,
typename opaque::inherited_from_underlying<T>
::template type<Final, Base>
@@ -83,10 +88,8 @@
typename mpl::push_front<
typename mpl::push_front<
MetaMixinSeq,
- transitive_substituable<base_public_opaque_type, T>
- //opaque::inherited_from_underlying<T>
+ opaque::transitive_substituable<base_public_opaque_type, T>
>::type,
- // transitive_substituable<base_public_opaque_type, T>
opaque::inherited_from_underlying<T>
>::type, Base
>
@@ -97,7 +100,7 @@
#if 0
new_class< Final, T, MetaMixinSeq,
#if !defined(COMPILER_WORKS)
- typename transitive_substituable_help<base_public_opaque_type,T>
+ typename opaque_detail::transitive_substituable_help<base_public_opaque_type,T>
::template type<Final, Base>
#else
typename transitive_substituable<base_public_opaque_type, T>
@@ -112,7 +115,7 @@
typename mpl::push_front<
typename mpl::push_front<
MetaMixinSeq,
- transitive_substituable<base_public_opaque_type, T>
+ opaque::transitive_substituable<base_public_opaque_type, T>
>::type,
opaque::inherited_from_underlying<T>
>::type, Base
@@ -144,7 +147,7 @@
: 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-07 18:40:32 EDT (Thu, 07 Oct 2010)
@@ -16,6 +16,7 @@
#include <boost/opaque/public_opaque_class.hpp>
namespace boost {
+namespace opaque {
template <
typename T,
@@ -48,7 +49,7 @@
: 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