Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73872 - sandbox/conversion/boost/conversion
From: vicente.botet_at_[hidden]
Date: 2011-08-17 18:53:08


Author: viboes
Date: 2011-08-17 18:53:06 EDT (Wed, 17 Aug 2011)
New Revision: 73872
URL: http://svn.boost.org/trac/boost/changeset/73872

Log:
conversion: added lvalue.hpp and implicitly.hpp files
Added:
   sandbox/conversion/boost/conversion/implicitly.hpp (contents, props changed)
   sandbox/conversion/boost/conversion/lvalue.hpp (contents, props changed)
Text files modified:
   sandbox/conversion/boost/conversion/assignable_to.hpp | 10 +---------
   sandbox/conversion/boost/conversion/convertible_from.hpp | 28 +---------------------------
   sandbox/conversion/boost/conversion/include.hpp | 2 ++
   3 files changed, 4 insertions(+), 36 deletions(-)

Modified: sandbox/conversion/boost/conversion/assignable_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/assignable_to.hpp (original)
+++ sandbox/conversion/boost/conversion/assignable_to.hpp 2011-08-17 18:53:06 EDT (Wed, 17 Aug 2011)
@@ -11,7 +11,7 @@
 
 /*!
  @file
- @brief Defines the @c assignable_to class and the factory @c lvalue.
+ @brief Defines the @c assignable_to class.
  */
 #ifndef BOOST_CONVERSION_ASSIGNABLE_TO_HPP
 #define BOOST_CONVERSION_ASSIGNABLE_TO_HPP
@@ -87,15 +87,7 @@
         return *this;
       }
     };
- //! makes an assignable to @c Target which accepts assignment from any type that is extrinsic assignable to @c Target.
 
- //! The result is able to transform assignments by assign_to calls.
- //! @NoThrow.
- template <typename Target>
- assignable_to<Target> lvalue(Target& r)
- {
- return assignable_to<Target>(r);
- }
   }
 }
 

Modified: sandbox/conversion/boost/conversion/convertible_from.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/convertible_from.hpp (original)
+++ sandbox/conversion/boost/conversion/convertible_from.hpp 2011-08-17 18:53:06 EDT (Wed, 17 Aug 2011)
@@ -12,7 +12,7 @@
 /*!
  @file
  @brief
- Defines the free function @c implicitly.
+ Defines the @c convertible_from class.
  */
 #ifndef BOOST_CONVERSION_CONVERTIBLE_FROM_HPP
 #define BOOST_CONVERSION_CONVERTIBLE_FROM_HPP
@@ -71,32 +71,6 @@
 
     };
 
- //! @brief makes a wrapper implicitly convertible to types extrinsicly implicit convertibles from @c Source.
- //!
- //! The result provides implicitly conversion to any type which is extrinsically 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(implicitly(v)) << " called" << std::endl;
- //! }
- //! };
- //! @endcode
-
- template <typename Source>
- typename enable_if_c<
- is_copy_constructible<Source>::value
- , convertible_from<Source>
- >::type
- implicitly(Source s)
- {
- return convertible_from<Source>(s);
- }
   }
 }
 #endif

Added: sandbox/conversion/boost/conversion/implicitly.hpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/boost/conversion/implicitly.hpp 2011-08-17 18:53:06 EDT (Wed, 17 Aug 2011)
@@ -0,0 +1,64 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+/*!
+ @file
+ @brief
+ Defines the free function @c implicitly.
+ */
+#ifndef BOOST_CONVERSION_IMPLICITLY_HPP
+#define BOOST_CONVERSION_IMPLICITLY_HPP
+
+#include <boost/conversion/config.hpp>
+#if defined(BOOST_CONVERSION_IMPLICITLY_ENABLED) || defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+
+#include <boost/conversion/convertible_from.hpp>
+#include <boost/conversion/implicit_convert_to.hpp>
+#include <boost/conversion/assign_to.hpp>
+#include <boost/conversion/is_extrinsically_convertible.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/conversion/type_traits/is_copy_constructible.hpp>
+
+namespace boost {
+ namespace conversion {
+
+ //! @brief makes a wrapper implicitly convertible to types extrinsicly implicit convertibles from @c Source.
+ //!
+ //! The result provides implicitly conversion to any type which is extrinsically 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(implicitly(v)) << " called" << std::endl;
+ //! }
+ //! };
+ //! @endcode
+
+ template <typename Source>
+ typename enable_if_c<
+ is_copy_constructible<Source>::value
+ , convertible_from<Source>
+ >::type
+ implicitly(Source s)
+ {
+ return convertible_from<Source>(s);
+ }
+ }
+}
+#endif
+
+#endif
+

Modified: sandbox/conversion/boost/conversion/include.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/include.hpp (original)
+++ sandbox/conversion/boost/conversion/include.hpp 2011-08-17 18:53:06 EDT (Wed, 17 Aug 2011)
@@ -21,7 +21,9 @@
 #include <boost/conversion/assign_to.hpp>
 #include <boost/conversion/convertible_to.hpp>
 #include <boost/conversion/convertible_from.hpp>
+#include <boost/conversion/implicitly.hpp>
 #include <boost/conversion/assignable_to.hpp>
+#include <boost/conversion/lvalue.hpp>
 #include <boost/conversion/try_convert_to.hpp>
 #include <boost/conversion/convert_to_or_fallback.hpp>
 #include <boost/conversion/try_assign_to.hpp>

Added: sandbox/conversion/boost/conversion/lvalue.hpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/boost/conversion/lvalue.hpp 2011-08-17 18:53:06 EDT (Wed, 17 Aug 2011)
@@ -0,0 +1,43 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+/*!
+ @file
+ @brief Defines the free function @c lvalue.
+ */
+#ifndef BOOST_CONVERSION_LVALUE_HPP
+#define BOOST_CONVERSION_LVALUE_HPP
+
+#include <boost/conversion/assignable_to.hpp>
+#include <boost/conversion/convert_to.hpp>
+#include <boost/conversion/assign_to.hpp>
+#include <boost/conversion/is_extrinsically_convertible.hpp>
+#include <boost/conversion/is_extrinsically_assignable.hpp>
+#include <boost/utility/enable_if.hpp>
+
+namespace boost {
+ namespace conversion {
+
+
+ //! makes an assignable to @c Target which accepts assignment from any type that is extrinsic assignable to @c Target.
+
+ //! The result is able to transform assignments by assign_to calls.
+ //! @NoThrow.
+ template <typename Target>
+ assignable_to<Target> lvalue(Target& r)
+ {
+ return assignable_to<Target>(r);
+ }
+ }
+}
+
+#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