Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2004-07-29 16:39:46


It took some digging but I figured out what the problem with the failure
on this test is for CW8. Basically CW8 is doing a copy construction on
the use of static_cast for a reference when the type of the reference is
itself a template typename. In all other cases it does the cast
correctly. The work-around is to do the cast on the pointer type and
dereference instead of the cast on the reference directly:

===================================================================
RCS file: /cvsroot/boost/boost/boost/algorithm/string/classification.hpp,v
retrieving revision 1.4
diff -u -r1.4 classification.hpp
--- classification.hpp 15 Jul 2004 21:48:25 -0000 1.4
+++ classification.hpp 29 Jul 2004 21:32:49 -0000
@@ -236,8 +236,8 @@
              const predicate_facade<Pred2T>& Pred2 )
          {
              return detail::pred_andF<Pred1T,Pred2T>(
- static_cast<const Pred1T&>(Pred1),
- static_cast<const Pred2T&>(Pred2) );
+ *static_cast<const Pred1T*>(&Pred1),
+ *static_cast<const Pred2T*>(&Pred2) );
          }

          //! predicate 'or' composition predicate
@@ -257,8 +257,8 @@
              const predicate_facade<Pred2T>& Pred2 )
          {
              return detail::pred_orF<Pred1T,Pred2T>(
- static_cast<const Pred1T&>(Pred1),
- static_cast<const Pred2T&>(Pred2));
+ *static_cast<const Pred1T*>(&Pred1),
+ *static_cast<const Pred2T*>(&Pred2));
          }

          //! predicate negation operator
@@ -273,7 +273,7 @@
          inline detail::pred_notF<PredT>
          operator!( const predicate_facade<PredT>& Pred )
          {
- return detail::pred_notF<PredT>(static_cast<const
PredT&>(Pred));
+ return detail::pred_notF<PredT>(*static_cast<const
PredT*>(&Pred));
          }

      } // namespace algorithm
===================================================================

Those changes make it work on CW8, and it still works on VC7.1 and MinGW.

OK to commit?? -- I'll assume the answer is *yes* after a few hours ;-)

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk