|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65723 - sandbox/opaque/boost/opaque
From: vicente.botet_at_[hidden]
Date: 2010-10-02 08:26:30
Author: viboes
Date: 2010-10-02 08:26:28 EDT (Sat, 02 Oct 2010)
New Revision: 65723
URL: http://svn.boost.org/trac/boost/changeset/65723
Log:
Opaque:
* make transitive substitutable a meta-mixin
Text files modified:
sandbox/opaque/boost/opaque/public_opaque_class.hpp | 27 +++++++++++++++++++++++++--
sandbox/opaque/boost/opaque/transitive_substituable.hpp | 8 ++++----
2 files changed, 29 insertions(+), 6 deletions(-)
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 08:26:28 EDT (Sat, 02 Oct 2010)
@@ -39,23 +39,46 @@
typedef mpl::vector<T> type;
};
+ 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, UT, Base>
+ >
+
+ {
+ operator UT() const {
+ return Final::final(this).underlying();
+ }
+ };
+ };
+
template <typename Final, typename T, typename Concepts=boost::mpl::vector0<>, typename Base=base_public_opaque_type>
class public_opaque_class
: public
new_class< Final, T, Concepts,
- transitive_substituable<base_public_opaque_type>::template type<Final, T,
+#define COMPILER_WORKS
+#if !defined(COMPILER_WORKS)
+ 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, T, Base>
>
+#endif
>
{
typedef
new_class< Final, T, Concepts,
- transitive_substituable<base_public_opaque_type>::template type<Final, T,
+#if !defined(COMPILER_WORKS)
+ 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, T, Base>
>
+#endif
>
base_type;
Modified: sandbox/opaque/boost/opaque/transitive_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/transitive_substituable.hpp (original)
+++ sandbox/opaque/boost/opaque/transitive_substituable.hpp 2010-10-02 08:26:28 EDT (Sat, 02 Oct 2010)
@@ -19,7 +19,7 @@
namespace boost {
- template <typename BaseClass>
+ template <typename BaseClass, typename UT>
struct transitive_substituable;
namespace detail {
@@ -29,16 +29,16 @@
template <typename BaseClass, typename Final, typename UT, typename Base>
struct transitive_substituable_next_level<BaseClass, Final, UT, Base, true>
- : transitive_substituable<BaseClass>::template type<Final, typename UT::underlying_type, Base> { };
+ : 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>
+ template <typename BaseClass, typename UT>
struct transitive_substituable {
- template <typename Final, typename UT, typename Base>
+ 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>
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