|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72942 - in sandbox/conversion/boost/conversion: . fp
From: vicente.botet_at_[hidden]
Date: 2011-07-06 20:32:35
Author: viboes
Date: 2011-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
New Revision: 72942
URL: http://svn.boost.org/trac/boost/changeset/72942
Log:
conversion: update comments
Text files modified:
sandbox/conversion/boost/conversion/assign_to.hpp | 7 +++++++
sandbox/conversion/boost/conversion/convertible_from.hpp | 11 +++++++++++
sandbox/conversion/boost/conversion/explicit_convert_to.hpp | 6 ++++++
sandbox/conversion/boost/conversion/fp/convert_to.hpp | 15 +++++++++------
sandbox/conversion/boost/conversion/implicit_convert_to.hpp | 6 ++++++
sandbox/conversion/boost/conversion/try_assign_to.hpp | 11 ++++++++---
sandbox/conversion/boost/conversion/try_convert_to.hpp | 6 ++++++
7 files changed, 53 insertions(+), 9 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-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
@@ -279,6 +279,13 @@
//! @Effects The ones of the assigner customization point.
//! @Throws Whatever the assigner customization point throws.
+ //! @Example
+ //! @code
+ //! Target t;
+ //! Source s;
+ //! boost::conversion::assign_to(t,s);
+ //! @endcode
+
template <typename Target, typename Source>
Target& assign_to(Target& to, const Source& from)
Modified: sandbox/conversion/boost/conversion/convertible_from.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/convertible_from.hpp (original)
+++ sandbox/conversion/boost/conversion/convertible_from.hpp 2011-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
@@ -64,6 +64,17 @@
//! The result provides implicitly conversion to any type which is extrinsic implicit convertible from @c Source.
//! @Returns convertible_from<Source>(s).
//! @NoThrow.
+ //! @Example
+ //! @code
+ //! template <typename T>
+ //! struct test {
+ //! static void fct()
+ //! {
+ //! T v;
+ //! std::cout << f(mcf(v)) << " called" << std::endl;
+ //! }
+ //! };
+ //! @endcode
template <typename Source>
convertible_from<Source> mcf(Source s)
{
Modified: sandbox/conversion/boost/conversion/explicit_convert_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/explicit_convert_to.hpp (original)
+++ sandbox/conversion/boost/conversion/explicit_convert_to.hpp 2011-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
@@ -247,6 +247,12 @@
//! @Returns The result of @c explicit_converter customization point.
//! @Throws Whatever the @c explicit_converter call operator throws.
//!
+ //! @Example
+ //! @code
+ //! Target t;
+ //! Source s;
+ //! t=boost::conversion::explicit_convert_to(s);
+ //! @endcode
template <typename Target, typename Source>
Target
explicit_convert_to(Source const& from)
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-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
@@ -92,8 +92,8 @@
//! @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.
+ //! @Returns A unary functor that will call to the @c convert_to<Target> function on its parameter.
+ //! @Throws Whatever the construction of the functor can throw.
//! @Example
//! @code
//! boost::conversion::make_converter_to<int>(_1)(v);
@@ -116,10 +116,10 @@
//! @brief Lazily convert to a type @c Target from an arbitrary argument.
//!
- //! This overload of @c 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 Boost.Phoenix Actor.
//!
- //! @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.
+ //! @Returns A unary functor that will call to the @c convert_to<Target> function on its parameter.
+ //! @Throws Whatever the construction of the functor can throw.
//! @Example
//! @code
//! boost::conversion::convert_to<int>(_1)(v);
@@ -132,7 +132,10 @@
typename expression::convert_to<boost::phoenix::detail::target<Target>, Source>::type const
>::type
#else
- unspecified_converter_type
+ typename enable_if<typename boost::conversion::enable_functor<Source>::type,
+ typename expression::convert_to<boost::phoenix::detail::target<Target>, Source>::type const
+ >::type
+ //unspecified_converter_type
#endif
convert_to(Source const& u)
{
Modified: sandbox/conversion/boost/conversion/implicit_convert_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/implicit_convert_to.hpp (original)
+++ sandbox/conversion/boost/conversion/implicit_convert_to.hpp 2011-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
@@ -140,6 +140,12 @@
//! @Returns The result of @c converter customization point.
//! @Throws Whatever the @c converter call operator throws.
//!
+ //! @Example
+ //! @code
+ //! Target t;
+ //! Source s;
+ //! t=boost::conversion::implicit_convert_to(s);
+ //! @endcode
template <typename Target, typename Source>
Target
implicit_convert_to(Source const& from)
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-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
@@ -53,7 +53,7 @@
struct try_assigner
{
//! @Requires @c Target must be CopyConstructible and @c ::boost::conversion::assign_to(to, from) must be well formed.
- //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assignment operator.
+ //! @Effects Converts the @c from parameter to the @c to parameter, using @c assign_to.
//! @NoThrow
//! @Returns whether the assignment succeeded.
//! @Remarks The parameter to is not updated if the conversion fails.
@@ -134,9 +134,14 @@
//! @tparam Target target type of the conversion.
//! @tparam Source source type of the conversion.
- //! @Effects Converts the @c from parameter to the @c to parameter, using by default the assignment operator.
+ //! @Effects Converts the @c from parameter to the @c to parameter, using the @c try_assigner customization point.
//! @NoThrow
- //! @Returns the converted value if success or the fallback when conversion fails.
+ //! @Returns true if the conversion succeeds.
+ //! @Example
+ //! @code
+ //! Target t;
+ //! Source s;
+ //! bool b = boost::conversion::try_assign_to(t,s);
template <typename Target, typename Source>
bool try_assign_to(Target& to, const Source& from)
{
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-07-06 20:32:34 EDT (Wed, 06 Jul 2011)
@@ -99,6 +99,12 @@
//! @Effects Converts the @c from parameter to an instance of the @c Target type, using by default the conversion operator or copy constructor.
//! @NoThrow
//! @Returns A optional<Target> uninitialized when conversion fails.
+ //! @Example
+ //! @code
+ //! optional<Target> t;
+ //! Source s;
+ //! res=boost::conversion::try_convert_to(s);
+ //! @endcode
template <typename Target, typename Source>
optional<Target> try_convert_to(Source const& from) {
#if defined(BOOST_CONVERSION_DOUBLE_CP)
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