Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-04-26 00:06:42


John Maddock wrote:
> Can any experts in MWCW take a look at why
> libs/type_traits/extent_test.cpp fails all the tests? The
> implementation of the extent type trait is pretty simple, and Metrowerks
> is the only compiler that doesn't like it for some reason.

It doesn't differentiate between these two types of PTS structs...

template <class T, std::size_t R>
struct extent_imp<T[R],0>
{
    BOOST_STATIC_CONSTANT(std::size_t, value = R);
};
template <class T>
struct extent_imp<T[], 0>
{
    BOOST_STATIC_CONSTANT(std::size_t, value = 0);
};

And it picks the second all the time for int[n][m] and int[][].

Don't know what can be done about it though. Other than adding
__MWERKS__ to the guard that's there already...

===================================================================
RCS file: /cvsroot/boost/boost/boost/type_traits/extent.hpp,v
retrieving revision 1.2
diff -u -r1.2 extent.hpp
--- extent.hpp 16 Apr 2005 12:44:26 -0000 1.2
+++ extent.hpp 26 Apr 2005 05:02:24 -0000
@@ -71,7 +71,7 @@
     BOOST_STATIC_CONSTANT(std::size_t, value = R);
  };

-#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) &&
  !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) &&
  !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) && !defined(__MWERKS__)
  template <class T, std::size_t N>
  struct extent_imp<T[], N>
  {
===================================================================

Which makes the tests pass. I've checked this in as it can only hurt
CodeWarrior :-)

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

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