Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72305 - in sandbox/conversion/boost/conversion: . boost fp std
From: vicente.botet_at_[hidden]
Date: 2011-05-31 08:31:29


Author: viboes
Date: 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
New Revision: 72305
URL: http://svn.boost.org/trac/boost/changeset/72305

Log:
Conversion:: Moved mca to conversion namespace+replacing convert_to overloadings by specializations
Text files modified:
   sandbox/conversion/boost/conversion/assign_to.hpp | 2
   sandbox/conversion/boost/conversion/boost/array.hpp | 30 +++++---------
   sandbox/conversion/boost/conversion/boost/chrono_duration_to_posix_time_duration.hpp | 65 ++++---------------------------
   sandbox/conversion/boost/conversion/boost/chrono_time_point_to_posix_time_ptime.hpp | 51 ------------------------
   sandbox/conversion/boost/conversion/boost/interval.hpp | 29 ++++---------
   sandbox/conversion/boost/conversion/boost/optional.hpp | 81 +++++++++------------------------------
   sandbox/conversion/boost/conversion/boost/rational.hpp | 57 ++++++++++-----------------
   sandbox/conversion/boost/conversion/boost/tuple.hpp | 55 +++-----------------------
   sandbox/conversion/boost/conversion/ca_wrapper.hpp | 22 +++++-----
   sandbox/conversion/boost/conversion/convert_to_or_fallback.hpp | 6 +-
   sandbox/conversion/boost/conversion/fp/convert_to.hpp | 6 +-
   sandbox/conversion/boost/conversion/std/complex.hpp | 37 ++++++++++-------
   sandbox/conversion/boost/conversion/std/string.hpp | 54 --------------------------
   sandbox/conversion/boost/conversion/std/vector.hpp | 3
   sandbox/conversion/boost/conversion/try_assign_to.hpp | 16 +++---
   sandbox/conversion/boost/conversion/try_convert_to.hpp | 11 ++--
   16 files changed, 137 insertions(+), 388 deletions(-)

Modified: sandbox/conversion/boost/conversion/assign_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/assign_to.hpp (original)
+++ sandbox/conversion/boost/conversion/assign_to.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -50,7 +50,7 @@
 
       //! partial specialization for c-array types.
       template < typename To, typename From, std::size_t N >
- struct assign_to<To[N],From[N]>
+ struct assign_to<To[N],From[N],void>
       {
         //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assignment operator on each one of the array elements.
         //! @Throws Whatever the underlying assignment operator of the @c To class throws.

Modified: sandbox/conversion/boost/conversion/boost/array.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/array.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/array.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -25,12 +25,16 @@
 
 namespace boost {
 
- #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING && ! defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
   namespace conversion {
     namespace overload_workaround {
+
+ /**
+ * Partial specialization of @c convert_to for @c boost::array of the same size
+ */
       template < typename T1, typename T2, std::size_t N>
       struct convert_to< array<T1,N>, array<T2,N> >
       {
+ //! @Returns the array having as elements the result of the conversion of each one of the source array elements.
         inline static array<T1,N> apply(array<T2,N> const & from)
         {
           array<T1,N> to;
@@ -38,9 +42,13 @@
           return to;
         }
       };
+ /**
+ * Partial specialization of @c assign_to for @c boost::array of the same size
+ */
       template < typename T1, typename T2, std::size_t N>
       struct assign_to< array<T1,N>, array<T2,N> >
       {
+ //! @Effects assign to each one of the target array elements the conversion of the source array element.
         inline static array<T1,N>& apply(array<T1,N>& to, array<T2,N> const & from)
         {
           for (unsigned int i =0; i<N; ++i)
@@ -52,20 +60,8 @@
       };
     }
   }
- #else
- //! @brief @c convert_to overloading for source and target been @c boost::array of the same size.
- //!
- //! @Returns the array having as elements the conversion from the source array.
- template < typename T1, typename T2, std::size_t N>
- inline array<T1,N> convert_to(array<T2,N> const & from
- , conversion::dummy::type_tag<array<T1,N> > const&
- )
- {
- array<T1,N> to;
- boost::conversion::assign_to(to, from);
- return to;
- }
 
+ #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   //! @brief @c convert_to overloading for source and target been @c boost::array of the same size.
   //!
   //! @Effects converts each one of the source array elements and store the result in the corresponding index on the target array.
@@ -74,11 +70,7 @@
   inline array<T1,N>& assign_to(array<T1,N>& to, array<T2,N> const & from
   )
   {
- for (unsigned int i =0; i<N; ++i)
- {
- to[i]=boost::conversion::convert_to<T1>(from[i]);
- }
- return to;
+ return conversion::overload_workaround::assign_to<array<T1,N>, array<T2,N> >::apply(to, from);
   }
   #endif
 }

Modified: sandbox/conversion/boost/conversion/boost/chrono_duration_to_posix_time_duration.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/chrono_duration_to_posix_time_duration.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/chrono_duration_to_posix_time_duration.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -24,11 +24,13 @@
 #include <boost/config.hpp>
 
 namespace boost {
- #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING && ! defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
   namespace conversion {
     namespace overload_workaround {
+ //! @brief @c convert_to specialization for conversions from @c boost::chrono::duration<> to @c boost::posix_time::time_duration.
+ //!
         template < class Rep, class Period>
         struct convert_to<posix_time::time_duration, chrono::duration<Rep, Period> > {
+ //! @Returns the duration converted to seconds+nanoseconds following the boost::posix_time::time_duration formatting.
             inline static posix_time::time_duration apply(chrono::duration<Rep, Period> const & from)
             {
                 typedef chrono::duration<Rep, Period> src_duration_t;
@@ -45,62 +47,23 @@
                     #endif
             }
         };
- template < class Rep, class Period>
- struct assign_to<posix_time::time_duration, chrono::duration<Rep, Period> > {
- inline static posix_time::time_duration& apply(posix_time::time_duration& to, const chrono::duration<Rep, Period>& from)
- {
- to = boost::conversion::convert_to<posix_time::time_duration>(from);
- return to;
- }
- };
+ //! @brief @c convert_to overloading for conversions from @c boost::posix_time::time_duration to @c boost::chrono::duration<>.
+ //!
 
         template < class Rep, class Period>
         struct convert_to<chrono::duration<Rep, Period>, posix_time::time_duration> {
+ //! @Returns the duration cast from a nanoseconds duration initialized to the total number of nanosecond of the @c from parameter.
             inline static chrono::duration<Rep, Period> apply(posix_time::time_duration const & from)
             {
                 return chrono::duration_cast<chrono::duration<Rep, Period> >(chrono::nanoseconds(from.total_nanoseconds()));
             }
         };
- template < class Rep, class Period>
- struct assign_to<chrono::duration<Rep, Period>, posix_time::time_duration> {
- inline static chrono::duration<Rep, Period> & apply(chrono::duration<Rep, Period> & to, const posix_time::time_duration& from)
- {
- to = boost::conversion::convert_to<chrono::duration<Rep, Period> >(from);
- return to;
- }
- };
- }}
- template < class Rep, class Period>
- inline time_duration& assign_to(time_duration& to, const chrono::duration<Rep, Period>& from
- , conversion::dummy::type_tag<posix_time::time_duration> const&
- )
- {
- to = boost::conversion::convert_to<time_duration>(from);
- return to;
+ }
   }
- #else
+
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   namespace chrono {
- //! @brief @c convert_to overloading for conversions from @c boost::chrono::duration<> to @c boost::posix_time::time_duration.
- //!
- //! @Returns the duration converted to seconds+nanoseconds following the boost::posix_time::time_duration formatting.
 
- template < class Rep, class Period>
- inline posix_time::time_duration convert_to(chrono::duration<Rep, Period> const & from
- , conversion::dummy::type_tag<posix_time::time_duration> const&)
- {
- typedef duration<Rep, Period> src_duration_t;
- typedef nanoseconds duration_t;
- typedef duration_t::rep rep_t;
- rep_t d = chrono::duration_cast<duration_t>(from).count();
- rep_t sec = d/1000000000;
- rep_t nsec = d%1000000000;
- return posix_time::seconds(static_cast<long long>(sec))+
- #ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
- posix_time::nanoseconds(nsec);
- #else
- posix_time::microseconds((nsec+500)/1000);
- #endif
- }
     //! @brief @c assign_to overloading for conversions from @c boost::chrono::duration<> to @c boost::posix_time::time_duration.
     //!
     //! @Effects As if <c>to = boost::conversion::convert_to<duration<Rep, Period>>(from)</c>.
@@ -117,16 +80,6 @@
   }
 
   namespace posix_time {
- //! @brief @c convert_to overloading for conversions from @c boost::posix_time::time_duration to @c boost::chrono::duration<>.
- //!
- //! @Returns the duration cast from a nanoseconds duration initialized to the total number of nanosecond of the @c from parameter.
-
- template < class Duration>
- inline Duration convert_to(time_duration const & from
- , conversion::dummy::type_tag<Duration> const&)
- {
- return chrono::duration_cast<Duration>(chrono::nanoseconds(from.total_nanoseconds()));
- }
 
     //! @brief @c assign_to overloading for conversions from @c boost::posix_time::time_duration to @c boost::chrono::duration<>.
     //!

Modified: sandbox/conversion/boost/conversion/boost/chrono_time_point_to_posix_time_ptime.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/chrono_time_point_to_posix_time_ptime.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/chrono_time_point_to_posix_time_ptime.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -26,7 +26,6 @@
 #include <boost/config.hpp>
 
 namespace boost {
- #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING && ! defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
     namespace conversion { namespace overload_workaround {
         template < class Clock, class Duration>
         struct convert_to<posix_time::ptime, chrono::time_point<Clock, Duration> > {
@@ -47,14 +46,6 @@
 #endif
             }
         };
- template < class Clock, class Duration>
- struct assign_to<posix_time::ptime, chrono::time_point<Clock, Duration> > {
- inline static posix_time::ptime& apply(posix_time::ptime& to, const chrono::time_point<Clock, Duration>& from)
- {
- to = boost::conversion::convert_to<posix_time::ptime>(from);
- return to;
- }
- };
 
         template < class Clock, class Duration>
         struct convert_to<chrono::time_point<Clock, Duration>, posix_time::ptime> {
@@ -66,37 +57,10 @@
                 return t+chrono::duration_cast<Duration>(chrono::nanoseconds(nsec));
             }
         };
- template < class Clock, class Duration>
- struct assign_to<chrono::time_point<Clock, Duration>, posix_time::ptime> {
- inline static chrono::time_point<Clock, Duration>& apply(chrono::time_point<Clock, Duration>& to, const posix_time::ptime& from)
- {
- to = boost::conversion::convert_to<chrono::time_point<Clock, Duration> >(from);
- return to;
- }
- };
     }}
- #else
- namespace chrono {
- template < class Clock, class Duration>
- inline posix_time::ptime convert_to(const chrono::time_point<Clock, Duration>& from
- , conversion::dummy::type_tag<posix_time::ptime> const&)
- {
- typedef chrono::time_point<Clock, Duration> time_point_t;
- typedef chrono::nanoseconds duration_t;
- typedef duration_t::rep rep_t;
- rep_t d = chrono::duration_cast<duration_t>(from.time_since_epoch()).count();
- rep_t sec = d/1000000000;
- rep_t nsec = d%1000000000;
- return posix_time::from_time_t(0)+
- posix_time::seconds(static_cast<long>(sec))+
-#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
- posix_time::nanoseconds(nsec);
-#else
- posix_time::microseconds((nsec+500)/1000);
-#endif
- }
-
 
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+ namespace chrono {
         template < class Clock, class Duration>
         inline chrono::time_point<Clock, Duration>& assign_to(chrono::time_point<Clock, Duration>& to, const posix_time::ptime& from
         )
@@ -108,17 +72,6 @@
     }
 
     namespace posix_time {
- template < class TP>
- inline TP convert_to(const ptime& from
- , conversion::dummy::type_tag<TP > const&)
- {
- time_duration const time_since_epoch=from-from_time_t(0);
- TP t=chrono::system_clock::from_time_t(time_since_epoch.total_seconds());
- long long nsec=time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second());
- return t+chrono::duration_cast<typename TP::duration>(chrono::nanoseconds(nsec));
- }
-
-
         template < class Clock, class Duration>
         inline ptime& assign_to(ptime& to, const chrono::time_point<Clock, Duration>& from
         )

Modified: sandbox/conversion/boost/conversion/boost/interval.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/interval.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/interval.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -23,10 +23,13 @@
 
 namespace boost {
 
- #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING && ! defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
- namespace conversion { namespace overload_workaround {
+ namespace conversion {
+ namespace overload_workaround {
+ //! @brief @c convert_to specialization for source and target been @c boost::numeric::interval.
+ //!
         template < class T, class PT, class U, class PU>
         struct convert_to< numeric::interval<T,PT>, numeric::interval<U,PU> > {
+ //! @Returns the target interval having as extremes the conversion from the source interval extremes.
             inline static numeric::interval<T,PT> apply(numeric::interval<U,PU> const & from)
             {
                 return numeric::interval<T,PT>(boost::conversion::convert_to<T>(from.lower()), boost::conversion::convert_to<U>(from.upper()));
@@ -40,30 +43,18 @@
                 return to;
             }
         };
-
- }}
- #else
+ }
+ }
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
     namespace numeric {
- //! @brief @c convert_to overloading for source and target been @c boost::numeric::interval.
- //!
- //! @Returns the target interval having as extremes the conversion from the source interval extremes.
- template < class T, class PT, class U, class PU>
- inline interval<T,PT> convert_to(interval<U,PU> const & from
- , ::boost::conversion::dummy::type_tag<interval<T,PT> > const&p=::boost::conversion::dummy::type_tag<interval<T,PT> >()
- )
- {
- (void)p; // warning removal
- return interval<T,PT>(boost::conversion::convert_to<T>(from.lower()), boost::conversion::convert_to<U>(from.upper()));
- }
         template < class T, class PT, class U, class PU>
         inline interval<T,PT>& assign_to(interval<T,PT>& to, const interval<U,PU>& from
         )
         {
- to.assign(boost::conversion::convert_to<T>(from.lower()),boost::conversion::convert_to<U>(from.upper()));
- return to;
+ return conversion::overload_workaround::assign_to<interval<T,PT>, interval<U,PU> >::apply(to, from);
         }
     }
- #endif
+#endif
 }
 
 #endif

Modified: sandbox/conversion/boost/conversion/boost/optional.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/optional.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/optional.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -28,12 +28,28 @@
 
 namespace boost {
 
-#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING && ! defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+ namespace conversion {
+ namespace detail {
+ template <typename T>
+ struct is_optional : mpl::false_ {};
+ template <typename T>
+ struct is_optional< ::boost::optional<T> > : mpl::true_ {};
+
+ }
+ }
+#endif
+
   namespace conversion {
     namespace overload_workaround {
+ /**
+ * Partial specialization of @c convert_to for boost::optional
+ */
       template < class Target, class Source>
       struct convert_to< optional<Target>, optional<Source> >
       {
+ //! @Returns If the optional source is initialized @c boost::optional<Target> initialized to the conversion of the optional value.
+ //! Uninitialized @c boost::optional<Target otherwise.
         inline static optional<Target> apply(optional<Source> const & from)
         {
           return (from?optional<Target>(boost::conversion::convert_to<Target>(from.get())):optional<Target>());
@@ -55,70 +71,11 @@
           }
         }
       };
-
- template < class Target, class Source>
- struct assign_to< optional<Target>, optional<Source> >
- {
- inline static optional<Target>& apply(optional<Target>& to, const optional<Source>& from)
- {
- to = from?optional<Target>(boost::conversion::convert_to<Target>(from.get())):optional<Target>();
- return to;
- }
- };
-
- }
- }
-#else
- #if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
- namespace conversion {
- namespace detail {
- template <typename T>
- struct is_optional : mpl::false_ {};
- template <typename T>
- struct is_optional< ::boost::optional<T> > : mpl::true_ {};
 
- }
     }
- #endif
- //! @brief @c convert_to overloading for source and target been @c boost::optional.
- //!
- //! @Returns If the optional source is initialized @c boost::optional<Target> initialized to the conversion of the optional value.
- //! Uninitialized @c boost::optional<Target otherwise.
- template < class Target, class Source>
- inline
- typename enable_if<typename conversion::detail::is_optional<Target>::type,Target>::type
- convert_to(
- optional<Source> const & from
- , conversion::dummy::type_tag<Target> const&p=conversion::dummy::type_tag<Target>()
- )
- {
- (void)p; // warning removal
- return (from?Target(boost::conversion::convert_to<typename Target::value_type>(from.get())):Target());
   }
 
-#if 0
- //! @brief @c convert_to overloading to try to convert the source to the target.
- //!
- //! We can see this overloading as a try_convert_to function.
- //! @Returns If the source is convertible to the target @c value_type @c boost::optional<Target> initialized to the result of the conversion.
- //! Uninitialized @c boost::optional<Target otherwise.
- template < class Target, class Source>
- inline
- typename enable_if<typename conversion::detail::is_optional<Target>::type,Target>::type
- convert_to(Source const & from
- , conversion::dummy::type_tag<Target> const&p=conversion::dummy::type_tag<Target>()
- )
- {
- try
- {
- return Target(boost::conversion::convert_to<typename Target::value_type>(from));
- }
- catch (...)
- {
- return Target();
- }
- }
-#endif
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   //! @brief @c assign_to overloading for source and target been @c boost::optional.
   //!
   //! @Effects As if <c>to = boost::conversion::convert_to<optional<Target> >(from)</c>.
@@ -128,10 +85,10 @@
   )
   {
     to = boost::conversion::convert_to<optional<Target> >(from);
- //to = from?optional<Target>(boost::conversion::convert_to<Target>(from.get())):optional<Target>();
     return to;
   }
 #endif
+
 }
 
 #endif

Modified: sandbox/conversion/boost/conversion/boost/rational.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/rational.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/rational.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -26,10 +26,25 @@
 
 namespace boost {
 
- #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING && ! defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
- namespace conversion { namespace overload_workaround {
+#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+ namespace conversion {
+ namespace detail {
+ template <typename T>
+ struct is_rational : mpl::false_ {};
+ template <typename T>
+ struct is_rational< ::boost::rational<T> > : mpl::true_ {};
+
+ }
+ }
+#endif
+
+ namespace conversion {
+ namespace overload_workaround {
+ //! @brief @c convert_to specialization for source and target been @c boost::rational.
+ //!
       template < class T, class U>
       struct convert_to< rational<T>, rational<U> > {
+ //! @Returns the target rational having as numerator and denominator the conversion from the numerator and denominator of the source rational.
         inline static rational<T> apply(rational<U> const & from)
         {
           return rational<T>(boost::conversion::convert_to<T>(from.numerator()), boost::conversion::convert_to<T>(from.denominator()));
@@ -44,44 +59,16 @@
         }
       };
 
- }}
- #else
-#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
- namespace conversion {
- namespace detail {
- template <typename T>
- struct is_rational : mpl::false_ {};
- template <typename T>
- struct is_rational< ::boost::rational<T> > : mpl::true_ {};
-
- }
- }
-#endif
- //! @brief @c convert_to overloading for source and target been @c boost::rational.
- //!
- //! @Returns the target rational having as numerator and denominator the conversion from the numerator and denominator of the source rational.
- template < class T, class U>
- inline
- typename enable_if<typename conversion::detail::is_rational<T>::type,T>::type
- convert_to(rational<U> const & from
- , conversion::dummy::type_tag<T> const&p=conversion::dummy::type_tag<T>()
- )
- {
- (void)p; // warning removal
- return T(boost::conversion::convert_to<typename T::int_type>(from.numerator()),
- boost::conversion::convert_to<typename T::int_type>(from.denominator())
- );
     }
+ }
 
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
     template < class T, class U>
- inline rational<T>& assign_to(rational<T>& to, const rational<U>& from
- )
+ inline rational<T>& assign_to(rational<T>& to, const rational<U>& from)
     {
- to.assign(boost::conversion::convert_to<T>(from.numerator()), boost::conversion::convert_to<T>(from.denominator()));
- return to;
+ return conversion::overload_workaround::assign_to<rational<T>, rational<U> >::apply(to, from);
     }
- #endif
-
+#endif
 
 }
 

Modified: sandbox/conversion/boost/conversion/boost/tuple.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/tuple.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/tuple.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -23,8 +23,8 @@
 
 namespace boost {
 
- #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING && ! defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
- namespace conversion { namespace overload_workaround {
+ namespace conversion {
+ namespace overload_workaround {
         template < class T1, class T2, class U1, class U2>
         struct convert_to< fusion::tuple<T1,T2>, fusion::tuple<U1,U2> > {
             inline static fusion::tuple<T1,T2> apply(fusion::tuple<U1,U2> const & from)
@@ -35,14 +35,6 @@
                 );
             }
         };
- template < class T1, class T2, class U1, class U2>
- struct assign_to< fusion::tuple<T1,T2>, fusion::tuple<U1,U2> > {
- inline static fusion::tuple<T1,T2>& apply(fusion::tuple<T1,T2>& to, fusion::tuple<U1,U2> const & from)
- {
- to = boost::conversion::convert_to<fusion::tuple<T1,T2> >(from);
- return to;
- }
- };
         template < class T1, class T2, class T3, class U1, class U2, class U3>
         struct convert_to< fusion::tuple<T1,T2,T3>, fusion::tuple<U1,U2,U3> > {
             inline static fusion::tuple<T1,T2,T3> apply(fusion::tuple<U1,U2,U3> const & from)
@@ -54,36 +46,17 @@
                 );
             }
         };
- template < class T1, class T2, class T3, class U1, class U2, class U3>
- struct assign_to< fusion::tuple<T1,T2,T3>, fusion::tuple<U1,U2,U3> > {
- inline static fusion::tuple<T1,T2,T3> apply(fusion::tuple<T1,T2,T3>& to, fusion::tuple<U1,U2,U3> const & from)
- {
- to = boost::conversion::convert_to<fusion::tuple<T1,T2> >(from);
- return to;
- }
- };
 
- }}
- #else
+ }
+ }
+
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
     namespace fusion {
 #if defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
- template < class Target..., class Source...>
- inline tuple<...Target> convert_to(tuple<...Source> const & from
- , conversion::dummy::type_tag<tuple<...Target> > const&);
- template < class Target..., class Source...>
- inline tuple<...Target>& assign_to(tuple<...Target>& to, tuple<...Source> const & from
- , conversion::dummy::type_tag<tuple<...Target> > const&
+ template < class... Target, class... Source>
+ inline tuple<Target...>& assign_to(tuple<Target...>& to, tuple<Source...> const & from
       )
 #else
- template < class T1, class T2, class U1, class U2>
- inline tuple<T1,T2> convert_to(tuple<U1,U2> const & from
- , conversion::dummy::type_tag<tuple<T1,T2> > const&)
- {
- return tuple<T1,T2>(
- boost::conversion::convert_to<T1>(boost::fusion::get<0>(from))
- , boost::conversion::convert_to<T2>(boost::fusion::get<1>(from))
- );
- }
 
     template < class T1, class T2, class U1, class U2>
     inline tuple<T1,T2>& assign_to(tuple<T1,T2>& to, tuple<U1,U2> const & from
@@ -94,18 +67,6 @@
     }
 
     template < class T1, class T2, class T3, class U1, class U2, class U3>
- inline tuple<T1,T2,T3> convert_to(tuple<U1,U2,U3> const & from
- , conversion::dummy::type_tag<tuple<T1,T2,T3> > const&
- )
- {
- return boost::fusion::tuple<T1,T2, T3>(
- boost::conversion::convert_to<T1>(boost::fusion::get<0>(from))
- , boost::conversion::convert_to<T2>(boost::fusion::get<1>(from))
- , boost::conversion::convert_to<T3>(boost::fusion::get<2>(from))
- );
- }
-
- template < class T1, class T2, class T3, class U1, class U2, class U3>
     inline tuple<T1,T2,T3> assign_to(tuple<T1,T2,T3>& to, boost::fusion::tuple<U1,U2,U3> const & from
     )
     {

Modified: sandbox/conversion/boost/conversion/ca_wrapper.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/ca_wrapper.hpp (original)
+++ sandbox/conversion/boost/conversion/ca_wrapper.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -37,7 +37,7 @@
       ca_wrapper(T& r) : ref_(r) {}
 
       //! Implicit conversion to @c U.
- //! @Effect Forwards the conversion from the reference using @c conver_to.
+ //! @Effects Forwards the conversion from the reference using @c conver_to.
       //! @Returns @c *this
       //! @Throws Whatever @c convert_to throws.
       template <typename U>
@@ -47,7 +47,7 @@
 
       //! Assignment.
       //!
- //! @Effect Forwards the assignment to the reference.
+ //! @Effects Forwards the assignment to the reference.
       //! @Returns @c *this
       //! @Throws Whatever @c T assignment can throws.
       ca_wrapper& operator =(ca_wrapper<T> const& u) {
@@ -57,7 +57,7 @@
 
       //! Assignment from a converter assigner wrapping a type U convertible to T.
       //!
- //! @Effect Forwards the assignment to the reference using assign_to.
+ //! @Effects Forwards the assignment to the reference using assign_to.
       //! @Returns @c *this
       //! @Throws Whatever @c assign_to throws.
       template <typename U>
@@ -68,7 +68,7 @@
 
       //! Assignment from a type U convertible to T.
       //!
- //! @Effect Forwards the assignment to the reference using assign_to
+ //! @Effects Forwards the assignment to the reference using assign_to
       //! @Returns @c *this
       //! @Throws Whatever @c assign_to throws.
       template <typename U>
@@ -77,14 +77,14 @@
         return *this;
       }
     };
- }
- //! makes a converter assigner wrapper of the reference parameter.
+ //! makes a converter assigner wrapper of the reference parameter.
 
- //! The result is able to transform conversion by convert_to calls and assignments by assign_to calls.
- //! @NoThrow.
- template <typename T>
- conversion::ca_wrapper<T> mca(T& r) {
- return conversion::ca_wrapper<T>(r);
+ //! The result is able to transform conversion by convert_to calls and assignments by assign_to calls.
+ //! @NoThrow.
+ template <typename T>
+ ca_wrapper<T> mca(T& r) {
+ return ca_wrapper<T>(r);
+ }
   }
 }
 

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-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -46,7 +46,7 @@
         //!
         //! @Effects Converts the @c from parameter to an instance of the @c To type, using by default the conversion operator or copy constructor.
         //! @Returns the converted value if the conversion succeeds or the fallback.
- //! @NoThows
+ //! @NoThrow
         inline static To apply(const From& val, Fallback const& fallback)
         {
           try
@@ -68,7 +68,7 @@
       //!
       //! @Effects Converts the @c from parameter to an instance of the @c To type, using by default the conversion operator or copy constructor.
       //! @Returns the converted value if the conversion succeeds or the fallback.
- //! @NoThows
+ //! @NoThrow
       //! Forwards the call to the overload workaround, which can yet be specialized by the user for standard C++ types.
       template < typename To, typename From, typename Fallback >
       To convert_to_or_fallback(const From& val, Fallback const& fallback, dummy::type_tag<To> const&) {
@@ -89,7 +89,7 @@
     //!
     //! @Effects Converts the @c from parameter to an instance of the @c To type, using by default the conversion operator or copy constructor.
     //! @Returns the converted value if the conversion succeeds or the fallback.
- //! @NoThows
+ //! @NoThrow
     //!
     //! 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.

Modified: sandbox/conversion/boost/conversion/fp/convert_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/fp/convert_to.hpp (original)
+++ sandbox/conversion/boost/conversion/fp/convert_to.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -77,7 +77,7 @@
 
   namespace conversion {
 
- //! @brief Lazily convert to a type @Target from an arbitrary argument.
+ //! @brief Lazily convert to a type @c Target from an arbitrary argument.
     //!
     //! @Returns A unary functor that will call to the convert_to function on its parameter.
     //! @Throws Whatever the underlying conversion @c To operator of the @c From class or the copy constructor of the @c To class throws.
@@ -101,9 +101,9 @@
       make(boost::phoenix::detail::target<T>(), u);
     }
 
- //! @brief Lazily convert to a type @Target from an arbitrary argument.
+ //! @brief Lazily convert to a type @c Target from an arbitrary argument.
     //!
- //! This overload of @convert_to is taken in account when the parameter @c Source is a place_holder.
+ //! This overload of @c convert_to is taken in account when the parameter @c Source is a place_holder.
     //!
     //! @Returns A unary functor that will call to the convert_to function on its parameter.
     //! @Throws Whatever the underlying conversion @c To operator of the @c From class or the copy constructor of the @c To class throws.

Modified: sandbox/conversion/boost/conversion/std/complex.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/std/complex.hpp (original)
+++ sandbox/conversion/boost/conversion/std/complex.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -26,22 +26,27 @@
 
     // std namespace can not be overloaded
     namespace overload_workaround {
- template < class T, class U>
- struct convert_to< std::complex<T>, std::complex<U> > {
- inline static std::complex<T> apply(std::complex<U> const & from)
- {
- return std::complex<T>(boost::conversion::convert_to<T>(from.real()), boost::conversion::convert_to<T>(from.imag()));
- }
- };
- template < class T, class U>
- struct assign_to< std::complex<T>, std::complex<U> > {
- inline static std::complex<T>& apply(std::complex<T>& to, const std::complex<U>& from)
- {
- to.real() = boost::conversion::convert_to<T>(from.real());
- to.imag() = boost::conversion::convert_to<T>(from.imag());
- return to;
- }
- };
+ /**
+ * Partial specialization of @c convert_to for @c std::complex of the same size
+ */
+ template < class T, class U>
+ struct convert_to< std::complex<T>, std::complex<U> > {
+ inline static std::complex<T> apply(std::complex<U> const & from)
+ {
+ return std::complex<T>(
+ boost::conversion::convert_to<T>(from.real()),
+ boost::conversion::convert_to<T>(from.imag()));
+ }
+ };
+ template < class T, class U>
+ struct assign_to< std::complex<T>, std::complex<U> > {
+ inline static std::complex<T>& apply(std::complex<T>& to, const std::complex<U>& from)
+ {
+ to.real() = boost::conversion::convert_to<T>(from.real());
+ to.imag() = boost::conversion::convert_to<T>(from.imag());
+ return to;
+ }
+ };
 
     }
   }

Modified: sandbox/conversion/boost/conversion/std/string.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/std/string.hpp (original)
+++ sandbox/conversion/boost/conversion/std/string.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -72,59 +72,7 @@
           return to;
         }
       };
-
-#if 0
- template<typename CharT, typename Traits, typename Alloc>
- struct convert_to< std::basic_string<CharT,Traits,Alloc>, bool > {
- inline static std::basic_string<CharT,Traits,Alloc>
- apply(bool const & from)
- {
-#if !defined(BOOST_CONVERSION_USE_CONVERT)
- return lexical_cast<std::basic_string<CharT,Traits,Alloc> >(from);
-#else
- return convert<std::basic_string<CharT,Traits,Alloc> >::from(from);
-#endif
- }
- };
-
- template<typename CharT, typename Traits, typename Alloc>
- struct convert_to< bool, std::basic_string<CharT,Traits,Alloc> > {
- inline static bool
- apply(std::basic_string<CharT,Traits,Alloc> const & from)
- {
-#if !defined(BOOST_CONVERSION_USE_CONVERT)
- return lexical_cast<bool>(from);
-#else
- return convert<bool>::from(from);
-#endif
- }
- };
-#endif
- template<>
- struct convert_to< std::string, bool > {
- inline static std::string
- apply(bool const & from)
- {
-#if !defined(BOOST_CONVERSION_USE_CONVERT)
- return lexical_cast<std::string >(from);
-#else
- return convert<std::string>::from(from);
-#endif
- }
- };
-
- template<>
- struct convert_to< bool, std::string > {
- inline static bool
- apply(std::string const & from)
- {
-#if !defined(BOOST_CONVERSION_USE_CONVERT)
- return lexical_cast<bool>(from);
-#else
- return convert<bool>::from(from);
-#endif
- }
- };
+
       
     }
   }

Modified: sandbox/conversion/boost/conversion/std/vector.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/std/vector.hpp (original)
+++ sandbox/conversion/boost/conversion/std/vector.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -24,7 +24,8 @@
 #include <boost/conversion/pack.hpp>
 
 
-namespace boost { namespace conversion {
+namespace boost {
+ namespace conversion {
 
     // std namespace can not be overloaded
     namespace overload_workaround {

Modified: sandbox/conversion/boost/conversion/try_assign_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/try_assign_to.hpp (original)
+++ sandbox/conversion/boost/conversion/try_assign_to.hpp 2011-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -44,8 +44,8 @@
       struct try_assign_to
       {
         //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assignment operator.
- //! @NoThrows
- //! @Return the converted value if success or the fallback when conversion fails.
+ //! @NoThrow
+ //! @Returns the converted value if success or the fallback when conversion fails.
         inline static bool apply(To& to, const From& from)
         {
           To rollback = to;
@@ -65,8 +65,8 @@
       struct try_assign_to<To[N],From[N]>
       {
         //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assignment operator on each vector element.
- //! @NoThrows
- //! @Return the converted value if success or the fallback when conversion fails.
+ //! @NoThrow
+ //! @Returns the converted value if success or the fallback when conversion fails.
         inline static bool apply(To(&to)[N], const From(& from)[N])
         {
           To rollback[N];
@@ -94,8 +94,8 @@
       //! @brief Default @c try_assign_to overload, used when ADL fails.
       //!
       //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assignment operator.
- //! @NoThrows
- //! @Return the converted value if success or the fallback when conversion fails.
+ //! @NoThrow
+ //! @Returns the converted value if success or the fallback when conversion fails.
       //! Forwards the call to the overload workaround, which can yet be specialized by the user for standard C++ types.
       template < typename To, typename From >
       bool try_assign_to(To& to, const From& from, dummy::type_tag<To> const&)
@@ -116,8 +116,8 @@
 #endif
 
     //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assignment operator.
- //! @NoThrows
- //! @Return the converted value if success or the fallback when conversion fails.
+ //! @NoThrow
+ //! @Returns the converted value if success or the fallback when conversion fails.
     //!
     //! This function can be partially specialized on compilers supporting it.
     template <typename Target, typename Source>

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-05-31 08:31:27 EDT (Tue, 31 May 2011)
@@ -40,28 +40,29 @@
 namespace boost {
   namespace conversion {
     namespace overload_workaround {
+#if 0
       //! @brief @c convert_to specialization to try to convert the source to @c Target::value_type when @c Target is optional.
       //!
       //! We can see this specialization as a try_convert_to function.
       template < class Target, class Source>
- struct convert_to< Target, Source, typename enable_if<typename conversion::detail::is_optional<Target>::type>::type >
+ struct convert_to< optional<Target>, Source>
       {
         //! @Returns If the source is convertible to the target @c value_type
         //! @c Target initialized to the result of the conversion.
         //! Uninitialized @c Target otherwise.
- inline static Target apply(Source const & from)
+ inline static optional<Target> apply(Source const & from)
         {
           try
           {
- return Target(boost::conversion::convert_to<typename Target::value_type>(from));
+ return optional<Target>(boost::conversion::convert_to<Target>(from));
           }
           catch (...)
           {
- return Target();
+ return optional<Target>();
           }
         }
       };
-
+#endif
       //! <c>struct try_convert_to</c> used when overloading can not be applied.
       //! This struct can be specialized by the user.
       template < typename To, typename 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