lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [lmi] passing objects instead of references to value_cast


From: Vadim Zeitlin
Subject: Re[2]: [lmi] passing objects instead of references to value_cast
Date: Mon, 30 Jun 2008 22:32:44 +0200

On Thu, 26 Jun 2008 17:24:40 +0000 Greg Chicares <address@hidden> wrote:

GC> On 20080626T1709Z I committed the remainder of this patch,

 This is really almost too trivial to mention but could you please apply
this tiny correction:

--- value_cast_test.cpp 2008-06-30 19:11:43 +0000
+++ value_cast_test.cpp 2008-06-30 19:12:24 +0000
@@ -726,7 +726,7 @@
     BOOST_TEST_EQUAL(true, value_cast<bool>(true));
     BOOST_TEST_EQUAL(false, value_cast<bool>(false));

-    // COMPILER !! Suppress this test for gcc-4.2.1, which refuses,
+    // COMPILER !! Suppress this test for gcc-4.1.2, which refuses,
     // defectively it would seem, to compile it. See:
     //   http://lists.nongnu.org/archive/html/lmi/2008-06/msg00010.html
 #if !(defined __GNUC__ && 40102 == LMI_GCC_VERSION)
--- end of patch ----------------------------------------------------------

GC> except for 'FromDeref'--is it necessary?

 It turns out it isn't [any more]. Sorry for leaving it in the patch, it
must be a leftover from my previous (and failed) experiments to make the
test work with g++ 4.1.2 without modifications.

 Anyhow, the following patch can be applied without any ill effect for
neither g++ 4.1.2 nor MSVC 7.1:

--- value_cast.hpp  2008-06-30 19:11:43 +0000
+++ value_cast.hpp  2008-06-30 20:24:05 +0000
@@ -184,8 +184,6 @@
 template<typename To, typename From>
 struct value_cast_choice
 {
-    typedef typename boost::remove_reference<From>::type FromDeref;
-
     enum
         {
         // Here, is_convertible means 'From' is convertible to 'To'.
@@ -202,8 +200,8 @@
     enum
         {
         one_numeric_one_string =
-                boost::is_arithmetic<FromDeref>::value && is_string<To>::value
-            ||  boost::is_arithmetic<To>::value && is_string<FromDeref>::value
+                boost::is_arithmetic<From>::value && is_string<To>::value
+            ||  boost::is_arithmetic<To>::value && is_string<From>::value
         };

     enum
--- end of patch ----------------------------------------------------------

 Thanks,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]