Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72321 - sandbox/conversion/boost/conversion
From: vicente.botet_at_[hidden]
Date: 2011-06-01 06:41:47


Author: viboes
Date: 2011-06-01 06:41:45 EDT (Wed, 01 Jun 2011)
New Revision: 72321
URL: http://svn.boost.org/trac/boost/changeset/72321

Log:
Conversion: remove base_tag
Text files modified:
   sandbox/conversion/boost/conversion/convert_to.hpp | 22 ++++++----------------
   sandbox/conversion/boost/conversion/convert_to_or_fallback.hpp | 3 +--
   sandbox/conversion/boost/conversion/try_convert_to.hpp | 3 +--
   3 files changed, 8 insertions(+), 20 deletions(-)

Modified: sandbox/conversion/boost/conversion/convert_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/convert_to.hpp (original)
+++ sandbox/conversion/boost/conversion/convert_to.hpp 2011-06-01 06:41:45 EDT (Wed, 01 Jun 2011)
@@ -36,21 +36,14 @@
 namespace boost {
   namespace conversion {
     namespace dummy {
- //! base tag used to overload a function returning T.
-
- //! @tparam T The wrapped type.
- template <typename T>
- struct base_tag {
- //! The nested type @c type names the template parameter.
-
- typedef T type;
- };
- //! tag used to overload a function returning T that takes precedence respect to &c base_tag<T>.
+ //! tag used to overload a function returning T.
       //!
- //! @tparam T The wrapped type.
+ //! @tparam T The wrapped return type.
       //! Users overloading the @c convert_to function must use this tag.
       template <typename T>
- struct type_tag : public base_tag<T> {
+ struct type_tag
+ //: public base_tag<T>
+ {
         //! The nested type @c type names the template parameter.
         typedef T type;
       };
@@ -114,7 +107,6 @@
     //!
     //! @Params
     //! @Param{source,source of the conversion}
- //! @Param{p,a dummy parameter used to allow overloading on the Target type}
     //!
     //! @Effects Converts the @c from parameter to an instance of the @c To type, using by default the conversion operator or copy constructor.
     //! @Throws Whatever the underlying conversion @c To operator of the @c From class or the copy constructor of the @c To class throws.
@@ -130,9 +122,7 @@
 #else
     Target
 #endif
- convert_to(Source const& from, dummy::base_tag<Target> const& p=dummy::base_tag<Target>()) {
- (void)p; // warning removal
-
+ convert_to(Source const& from) {
       return boost::conversion::impl::convert_to_impl<Target>(from);
     }
   }

Modified: sandbox/conversion/boost/conversion/convert_to_or_fallback.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/convert_to_or_fallback.hpp (original)
+++ sandbox/conversion/boost/conversion/convert_to_or_fallback.hpp 2011-06-01 06:41:45 EDT (Wed, 01 Jun 2011)
@@ -94,8 +94,7 @@
     //! This function can be partially specialized on compilers supporting it.
     //! A trick is used to partially specialize on the return type by adding a dummy parameter.
     template <typename Target, typename Source, typename Fallback>
- Target convert_to_or_fallback(Source const& from, Fallback const& fallback, dummy::base_tag<Target> const& p=dummy::base_tag<Target>()) {
- (void)p;
+ Target convert_to_or_fallback(Source const& from, Fallback const& fallback) {
       return conversion::impl::convert_to_or_fallback_impl<Target>(from, fallback);
     }
   }

Modified: sandbox/conversion/boost/conversion/try_convert_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/try_convert_to.hpp (original)
+++ sandbox/conversion/boost/conversion/try_convert_to.hpp 2011-06-01 06:41:45 EDT (Wed, 01 Jun 2011)
@@ -117,8 +117,7 @@
   //! This function can be overloaded by the user for specific types.
   //! A trick is used to partially specialize on the return type by adding a dummy parameter.
   template <typename Target, typename Source>
- optional<Target> try_convert_to(Source const& from, dummy::base_tag<Target> const& p=dummy::base_tag<Target>()) {
- (void)p;
+ optional<Target> try_convert_to(Source const& from) {
     return boost::conversion::impl::try_convert_to_impl<Target>(from);
   }
   }


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