Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65725 - sandbox/opaque/boost/opaque
From: vicente.botet_at_[hidden]
Date: 2010-10-02 13:11:42


Author: viboes
Date: 2010-10-02 13:11:39 EDT (Sat, 02 Oct 2010)
New Revision: 65725
URL: http://svn.boost.org/trac/boost/changeset/65725

Log:
Opaque:
* Add friend convert_to function on transitive explict substitutable

Text files modified:
   sandbox/opaque/boost/opaque/transitive_explicit_substituable.hpp | 18 +++++++++++++-----
   1 files changed, 13 insertions(+), 5 deletions(-)

Modified: sandbox/opaque/boost/opaque/transitive_explicit_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/transitive_explicit_substituable.hpp (original)
+++ sandbox/opaque/boost/opaque/transitive_explicit_substituable.hpp 2010-10-02 13:11:39 EDT (Sat, 02 Oct 2010)
@@ -41,22 +41,30 @@
     {};
 
     }
+ 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
- #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
- : Base {};
- #else
             : detail::transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base,
                     mpl::and_<is_class<UT>, is_base_of<BaseClass, UT> >::value>
         {
- explicit operator UT() const {
+ #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
+ };
     };
     
 


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