Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71172 - in sandbox/conversion/boost/conversion: . boost std
From: vicente.botet_at_[hidden]
Date: 2011-04-10 16:52:30


Author: viboes
Date: 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
New Revision: 71172
URL: http://svn.boost.org/trac/boost/changeset/71172

Log:
Conversion: update comments
Text files modified:
   sandbox/conversion/boost/conversion/assign_to.hpp | 7 +++++--
   sandbox/conversion/boost/conversion/boost/array.hpp | 6 ++++++
   sandbox/conversion/boost/conversion/boost/chrono_duration_to_posix_time_duration.hpp | 6 ++++++
   sandbox/conversion/boost/conversion/boost/chrono_time_point_to_posix_time_ptime.hpp | 6 ++++++
   sandbox/conversion/boost/conversion/boost/interval.hpp | 6 ++++++
   sandbox/conversion/boost/conversion/boost/optional.hpp | 6 ++++++
   sandbox/conversion/boost/conversion/boost/rational.hpp | 6 ++++++
   sandbox/conversion/boost/conversion/boost/tuple.hpp | 5 +++++
   sandbox/conversion/boost/conversion/convert_to.hpp | 4 +++-
   sandbox/conversion/boost/conversion/include.hpp | 6 ++++++
   sandbox/conversion/boost/conversion/pack.hpp | 30 +++++++++++++++++++++++++++++-
   sandbox/conversion/boost/conversion/std/complex.hpp | 11 +++++++++--
   sandbox/conversion/boost/conversion/std/pair.hpp | 5 +++++
   sandbox/conversion/boost/conversion/std/string.hpp | 17 +++++++++++++++--
   sandbox/conversion/boost/conversion/std/vector.hpp | 6 ++++++
   15 files changed, 119 insertions(+), 8 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-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -23,7 +23,8 @@
 The technique consists in partially specialize on the function @c assign_to on the @c boost::conversion namespace.
 For compilers for which we can not partially specialize a function a trick is used:
 instead of calling directly to the @c assign_to member function, @c assign_to calls to the static operation apply
-on a class with the same name in the namespace @c partial_specializationworkaround. Thus the user can specialize partially this class.
+on a class with the same name in the namespace @c partial_specialization_workaround.
+Thus the user can specialize partially this class.
 
  */
 
@@ -33,7 +34,6 @@
 #include <cstddef> //for std::size_t
 #include <boost/conversion/convert_to.hpp>
 
-#define FWD2
 namespace boost {
   #ifdef FWD
   template <typename Target, typename Source>
@@ -68,6 +68,7 @@
       };
     }
 
+
     template < typename To, typename From >
     To& assign_to(To& to, const From& from, dummy::type_tag<To> const&)
     {
@@ -75,6 +76,7 @@
     }
   }
 
+#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
   namespace conversion_impl {
     template <typename Target, typename Source>
     Target& assign_to_impl(Target& to, const Source& from)
@@ -84,6 +86,7 @@
       return assign_to(to, from, boost::dummy::type_tag<Target>());
     }
   }
+#endif
 
   //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assigment operator.
   //! @Throws Whatever the underlying the 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-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c boost::array<> of convertible types.
+ */
+
 #ifndef BOOST_CONVERSION_ARRAY_HPP
 #define BOOST_CONVERSION_ARRAY_HPP
 

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-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c boost::posix_time::time_duration and @c boost::chrono::duration<>.
+ */
+
 #ifndef BOOST_CONVERSION_CHRONO_DURATION_TO_POSIX_TIME_DURATION_HPP
 #define BOOST_CONVERSION_CHRONO_DURATION_TO_POSIX_TIME_DURATION_HPP
 

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-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c boost::ptime and @c boost::chrono::time_point<>.
+ */
+
 //[CHRONO_TIME_POINT_TO_POSIX_TIME_PTIME_HPP
 #ifndef BOOST_CONVERSION_CHRONO_TIME_POINT_TO_POSIX_TIME_PTIME_HPP
 #define BOOST_CONVERSION_CHRONO_TIME_POINT_TO_POSIX_TIME_PTIME_HPP

Modified: sandbox/conversion/boost/conversion/boost/interval.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/interval.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/interval.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c boost::numeric::interval<> of convertible types.
+ */
+
 #ifndef BOOST_CONVERSION_INTERVAL_HPP
 #define BOOST_CONVERSION_INTERVAL_HPP
 

Modified: sandbox/conversion/boost/conversion/boost/optional.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/optional.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/optional.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c boost::optional<> of convertible types.
+ */
+
 //[OPTIONAL_HPP
 #ifndef BOOST_CONVERSION_OPTIONAL_HPP
 #define BOOST_CONVERSION_OPTIONAL_HPP

Modified: sandbox/conversion/boost/conversion/boost/rational.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/rational.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/rational.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c boost::rational<> of convertible types.
+ */
+
 #ifndef BOOST_CONVERSION_PAIR__HPP
 #define BOOST_CONVERSION_PAIR__HPP
 

Modified: sandbox/conversion/boost/conversion/boost/tuple.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/tuple.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/tuple.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,11 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c boost::fusion::tuple<> of convertible types.
+ */
 #ifndef BOOST_CONVERSION_TUPLE_HPP
 #define BOOST_CONVERSION_TUPLE_HPP
 

Modified: sandbox/conversion/boost/conversion/convert_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/convert_to.hpp (original)
+++ sandbox/conversion/boost/conversion/convert_to.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -25,7 +25,7 @@
 
 The technique consists in partially specialize on the function @c convert_to on the @c boost::conversion namespace.
 For compilers for which we can not partially specialize a function a trick is used: instead of calling directly to the @c convert_to member function,
-_at_c convert_to calls to the static operation apply on a class with the same name in the namespace @c partial_specializationworkaround.
+@c convert_to calls to the static operation apply on a class with the same name in the namespace @c partial_specialization_workaround.
 Thus the user can specialize partially this class.
  */
 
@@ -53,6 +53,7 @@
       return conversion::partial_specialization_workaround::convert_to<To,From>::apply(val);
     }
   }
+#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
   namespace conversion_impl {
     template <typename Target, typename Source>
     Target convert_to_impl(Source const& from) {
@@ -61,6 +62,7 @@
       return convert_to(from, boost::dummy::type_tag<Target>());
     }
   }
+#endif
 
   //!
   //! @Effects Converts the @c from parameter to an instance of the @c To type, using by default the conversion operator or copy constructor.

Modified: sandbox/conversion/boost/conversion/include.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/include.hpp (original)
+++ sandbox/conversion/boost/conversion/include.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+Include all the core conversion public header files. Note that you will need to include explicitly the C++ standard or Boost specific files when using specific classes.
+ */
+
 #ifndef BOOST_CONVERSION_INCLUDE_HPP
 #define BOOST_CONVERSION_INCLUDE_HPP
 

Modified: sandbox/conversion/boost/conversion/pack.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/pack.hpp (original)
+++ sandbox/conversion/boost/conversion/pack.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -17,10 +17,24 @@
 #include <boost/fusion/include/at_c.hpp>
 #include <boost/fusion/support/pair.hpp>
 
+/*!
+ \file
+ \brief
+ Defines the pack function.
+
+
+ The result of the @c pack function is equivalent to a fusion sequence containing @c boost::reference_warpper's
+ instead of C++ reference (&) as this are not allowed.
+
+*/
+
 namespace boost { namespace conversion {
 
 
-namespace result_of {
+ namespace result_of {
+
+ //! metafunction getting a @c std::pair of @c boost::reference_warpper's.
+ //!
     template <typename T1, typename T2> struct pack2 {
         typedef
         std::pair<
@@ -29,6 +43,8 @@
         , boost::reference_wrapper<T2>
> type;
     };
+ //! metafunction getting a fusion sequence of @c boost::reference_warpper's.
+ //!
     template <typename T1, typename T2, typename T3=fusion::void_> struct pack3 {
         typedef fusion::tuple<
             boost::reference_wrapper<T1>
@@ -38,6 +54,8 @@
     };
 }
 
+//! packs together references.
+//!
 template <typename T1, typename T2>
 typename boost::conversion::result_of::pack2<T1 const, T2 const>::type pack(
         T1 const& t1, T2 const& t2) {
@@ -46,6 +64,8 @@
             (boost::cref(t1), boost::cref(t2));
 }
 
+//! packs together references.
+//!
 template <typename T1, typename T2>
 typename boost::conversion::result_of::pack2<T1 const, T2>::type pack(T1 const& t1, T2 & t2) {
         return std::make_pair
@@ -53,24 +73,32 @@
             (boost::cref(t1), boost::ref(t2));
 }
 
+//! packs together references.
+//!
 template <typename T1, typename T2, typename T3>
 typename boost::conversion::result_of::pack3<T1 const, T2 const, T3 const>::type pack(
         T1 const& t1, T2 const& t2, T3 const& t3) {
         return fusion::make_tuple(boost::cref(t1), boost::cref(t2), boost::cref(t3));
 }
 
+//! packs together references.
+//!
 template <typename T1, typename T2, typename T3>
 typename boost::conversion::result_of::pack3<T1 const, T2 const, T3>::type pack(
         T1 const& t1, T2 const& t2, T3 & t3) {
         return fusion::make_tuple(boost::cref(t1), boost::cref(t2), boost::ref(t3));
 }
 
+//! packs together references.
+//!
 template <typename T1, typename T2, typename T3>
 typename boost::conversion::result_of::pack3<T1 const, T2, T3 const>::type pack(
         T1 const& t1, T2 & t2, T3 const& t3) {
         return fusion::make_tuple(boost::cref(t1), boost::ref(t2), boost::cref(t3));
 }
 
+//! packs together references.
+//!
 template <typename T1, typename T2, typename T3>
 typename boost::conversion::result_of::pack3<T1 const, T2, T3>::type pack(
         T1 const& t1, T2 & t2, T3 & t3) {

Modified: sandbox/conversion/boost/conversion/std/complex.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/std/complex.hpp (original)
+++ sandbox/conversion/boost/conversion/std/complex.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c std::complex<> of convertible types.
+ */
+
 #ifndef BOOST_CONVERSION_STD_COMPLEX_HPP
 #define BOOST_CONVERSION_STD_COMPLEX_HPP
 
@@ -16,7 +22,7 @@
 #include <boost/conversion/assign_to.hpp>
 
 namespace boost {
-namespace conversion {
+ namespace conversion {
 
     // std namespace can not be overloaded
     namespace partial_specialization_workaround {
@@ -38,7 +44,8 @@
         };
 
     }
-}}
+ }
+}
 
 #endif
 

Modified: sandbox/conversion/boost/conversion/std/pair.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/std/pair.hpp (original)
+++ sandbox/conversion/boost/conversion/std/pair.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -7,6 +7,11 @@
 // See http://www.boost.org/libs/synchro for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c std::pair<> of convertible types.
+ */
 
 //[PAIR_HPP
 #ifndef BOOST_CONVERSION_STD_PAIR_HPP

Modified: sandbox/conversion/boost/conversion/std/string.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/std/string.hpp (original)
+++ sandbox/conversion/boost/conversion/std/string.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,14 +8,23 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions from/to @c std::string.
+ */
+
 #ifndef BOOST_CONVERSION_STD_STRING_HPP
 #define BOOST_CONVERSION_STD_STRING_HPP
 
 #include <string>
 #include <boost/conversion/convert_to.hpp>
 #include <boost/conversion/assign_to.hpp>
+#if defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+#include <boost/lexical_cast.hpp>
+#else
 #include <boost/convert/convert.hpp>
-
+#endif
 namespace boost {
 namespace conversion {
 
@@ -26,9 +35,13 @@
         struct convert_to< std::basic_string<CharT,Traits,Alloc>, T > {
             inline static std::basic_string<CharT,Traits,Alloc> apply(T const & from)
             {
+#if defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+ return lexical_cast<std::basic_string<CharT,Traits,Alloc> >(from);
+#else
                 return convert<std::basic_string<CharT,Traits,Alloc> >::from(from);
+#endif
             }
- }
+ };
         template<typename T, typename CharT, typename Traits, typename Alloc>
         struct assign_to< std::basic_string<CharT,Traits,Alloc>, T > {
             inline static std::basic_string<CharT,Traits,Alloc>& apply(std::basic_string<CharT,Traits,Alloc>& to, const T& from)

Modified: sandbox/conversion/boost/conversion/std/vector.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/std/vector.hpp (original)
+++ sandbox/conversion/boost/conversion/std/vector.hpp 2011-04-10 16:52:28 EDT (Sun, 10 Apr 2011)
@@ -8,6 +8,12 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+/*!
+ \file
+ \brief
+ Include this file when using conversions between @c std::vector<> of convertible types.
+ */
+
 //[VECTOR_HPP
 #ifndef BOOST_CONVERSION_STD_VECTOR_HPP
 #define BOOST_CONVERSION_STD_VECTOR_HPP


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