Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60351 - trunk/boost/spirit/home/phoenix/detail
From: joel_at_[hidden]
Date: 2010-03-08 10:54:24


Author: djowel
Date: 2010-03-08 10:54:23 EST (Mon, 08 Mar 2010)
New Revision: 60351
URL: http://svn.boost.org/trac/boost/changeset/60351

Log:
fix type-deduction for the odd case where the container is also the contained (container::value_type == container)
Text files modified:
   trunk/boost/spirit/home/phoenix/detail/type_deduction.hpp | 16 +++++++++++-----
   1 files changed, 11 insertions(+), 5 deletions(-)

Modified: trunk/boost/spirit/home/phoenix/detail/type_deduction.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/detail/type_deduction.hpp (original)
+++ trunk/boost/spirit/home/phoenix/detail/type_deduction.hpp 2010-03-08 10:54:23 EST (Mon, 08 Mar 2010)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2007 Joel de Guzman
 
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ 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)
 ==============================================================================*/
 #ifndef PHOENIX_DETAIL_TYPE_DEDUCTION_HPP
@@ -193,11 +193,11 @@
 #include <boost/preprocessor/cat.hpp>
 #include <boost/spirit/home/phoenix/detail/local_reference.hpp>
 
-namespace boost
+namespace boost
 {
     struct error_cant_deduce_type {};
 }
-
+
 namespace boost { namespace type_deduction_detail
 {
     typedef char(&bool_value_type)[1];
@@ -377,7 +377,10 @@
 
     template <typename X, typename Y>
     typename disable_if<
- is_basic<typename X::value_type>
+ mpl::or_<
+ is_basic<typename X::value_type>
+ , is_same<typename add_reference<X>::type, typename X::reference>
+ >
       , container_reference_type
>::type
     test(typename X::reference);
@@ -395,7 +398,10 @@
 
     template <typename X, typename Y>
     typename disable_if<
- is_basic<typename X::value_type>
+ mpl::or_<
+ is_basic<typename X::value_type>
+ , is_same<typename add_reference<X>::type, typename X::const_reference>
+ >
       , container_const_reference_type
>::type
     test(typename X::const_reference);


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