|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75057 - in sandbox/conversion/boost/conversion: . type_traits
From: vicente.botet_at_[hidden]
Date: 2011-10-18 17:49:26
Author: viboes
Date: 2011-10-18 17:49:25 EDT (Tue, 18 Oct 2011)
New Revision: 75057
URL: http://svn.boost.org/trac/boost/changeset/75057
Log:
Conversion: Add conversion from pointer
Text files modified:
sandbox/conversion/boost/conversion/explicit_convert_to.hpp | 11 +++++++++++
sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
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-10-18 17:49:25 EDT (Tue, 18 Oct 2011)
@@ -184,6 +184,17 @@
return explicit_convert_to(from, dummy::type_tag<Target>());
}
+ template <typename Target, typename Source>
+ typename enable_if_c<
+ is_extrinsically_explicitly_convertible_tagged<const Source*,Target>::value
+ , Target>::type
+ explicit_convert_to(const Source * from)
+ {
+ using namespace boost::conversion::impl_2;
+ //use boost::conversion::impl_2::explicit_convert_to if ADL fails
+ return explicit_convert_to(from, dummy::type_tag<Target>());
+ }
+
//! @brief @c explicit converter specialization to try to convert the source
//! to @c Target when the target type is @c optional<Target>.
//!
Modified: sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp 2011-10-18 17:49:25 EDT (Tue, 18 Oct 2011)
@@ -253,14 +253,14 @@
// Array types are default constructible if their element type
// is default constructible
- template <typename A, size_t N>
+ template <typename A, std::size_t N>
struct imp<false, A[N]>
: public ::boost::is_constructible<typename remove_all_extents<A>::type>
{};
// Otherwise array types are not constructible by this syntax
- template <typename A, size_t N, typename ...Args>
+ template <typename A, std::size_t N, typename ...Args>
struct imp<false, A[N], Args...>
: public false_type
{};
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